change: search debugtalk.py upward recursively until system root dir

This commit is contained in:
debugtalk
2020-06-07 12:51:45 +08:00
parent ab8a66f2b7
commit d5fea81ea6
2 changed files with 2 additions and 8 deletions

View File

@@ -13,6 +13,7 @@
- change: rename TestCaseInOut field, config_vars and export_vars - change: rename TestCaseInOut field, config_vars and export_vars
- change: rename StepData field, export_vars - change: rename StepData field, export_vars
- change: add `--tb=short` for `hrun` command to use shorter traceback format by default - change: add `--tb=short` for `hrun` command to use shorter traceback format by default
- change: search debugtalk.py upward recursively until system root dir
## 3.0.8 (2020-06-04) ## 3.0.8 (2020-06-04)

View File

@@ -265,7 +265,7 @@ def load_builtin_functions() -> Dict[Text, Callable]:
def locate_file(start_path: Text, file_name: Text) -> Text: def locate_file(start_path: Text, file_name: Text) -> Text:
""" locate filename and return absolute file path. """ locate filename and return absolute file path.
searching will be recursive upward until current working directory or system root dir. searching will be recursive upward until system root dir.
Args: Args:
file_name (str): target locate file name file_name (str): target locate file name
@@ -289,13 +289,6 @@ def locate_file(start_path: Text, file_name: Text) -> Text:
if os.path.isfile(file_path): if os.path.isfile(file_path):
return os.path.abspath(file_path) return os.path.abspath(file_path)
# current working directory
cwd = os.getcwd()
if os.path.abspath(start_dir_path) == cwd:
raise exceptions.FileNotFound(
f"{file_name} not found for {start_path}\ncurrent working directory: {cwd}"
)
# system root dir # system root dir
# Windows, e.g. 'E:\\' # Windows, e.g. 'E:\\'
# Linux/Darwin, '/' # Linux/Darwin, '/'