Browse Source

allow the parent dir

tags/v1.0.0
yuximiao 5 years ago
parent
commit
d651e18b65
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mindspore/profiler/common/validator/validate_path.py

+ 2
- 2
mindspore/profiler/common/validator/validate_path.py View File

@@ -19,7 +19,7 @@ import os
def validate_and_normalize_path(
path,
check_absolute_path=False,
allow_parent_dir=False,
allow_parent_dir=True,
):
"""
Validates path and returns its normalized form.
@@ -45,7 +45,7 @@ def validate_and_normalize_path(
if not allow_parent_dir:
path_components = path_str.split("/")
if ".." in path_components:
raise RuntimeError("The path is invalid!")
raise RuntimeError("The parent path is not allowed!")

# path does not have valid schema, treat it as unix local path.
if check_absolute_path:


Loading…
Cancel
Save