From ecfb6b6b3aa80d62ef9c3b1d617d25a8fed320d6 Mon Sep 17 00:00:00 2001 From: Tamas Kocsis Date: Mon, 30 Nov 2020 14:38:25 +0100 Subject: [PATCH] Rev4553, Debug messages formatting Windows fix --- src/Config.py | 2 +- src/Debug/Debug.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Config.py b/src/Config.py index cd1afb9d..f376c512 100644 --- a/src/Config.py +++ b/src/Config.py @@ -14,7 +14,7 @@ class Config(object): def __init__(self, argv): self.version = "0.7.2" - self.rev = 4551 + self.rev = 4553 self.argv = argv self.action = None self.test_parser = None diff --git a/src/Debug/Debug.py b/src/Debug/Debug.py index e6cf28a9..0ec42615 100644 --- a/src/Debug/Debug.py +++ b/src/Debug/Debug.py @@ -28,12 +28,11 @@ def formatExceptionMessage(err): return "%s: %s" % (err_type, err_message) -python_lib_dirs = [path for path in sys.path if path.endswith("/site-packages") or path.endswith("/dist-packages")] -python_lib_dirs.append(os.path.dirname(os.__file__)) # TODO: check if returns the correct path for PyPy +python_lib_dirs = [path.replace("\\", "/") for path in sys.path if re.sub(r".*[\\/]", "", path) in ("site-packages", "dist-packages")] +python_lib_dirs.append(os.path.dirname(os.__file__).replace("\\", "/")) # TODO: check if returns the correct path for PyPy -root_dir = os.path.realpath(__file__) -for _ in range(3): - root_dir = os.path.dirname(root_dir) +root_dir = os.path.realpath(os.path.dirname(__file__) + "/../../") +root_dir = root_dir.replace("\\", "/") def formatTraceback(items, limit=None, fold_builtin=True):