mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-15 20:38:44 +08:00
change: search debugtalk.py upward recursively until system root dir
This commit is contained in:
@@ -265,7 +265,7 @@ def load_builtin_functions() -> Dict[Text, Callable]:
|
||||
|
||||
def locate_file(start_path: Text, file_name: Text) -> Text:
|
||||
""" 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:
|
||||
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):
|
||||
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
|
||||
# Windows, e.g. 'E:\\'
|
||||
# Linux/Darwin, '/'
|
||||
|
||||
Reference in New Issue
Block a user