From c2d9743b9ad72a434d0c1f18567953a40c5c874f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 2 Mar 2020 17:48:41 +0100 Subject: [PATCH 1/2] added missing space to replacement string in traceback formatting --- pyblish/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyblish/lib.py b/pyblish/lib.py index 53da58f7..96780027 100644 --- a/pyblish/lib.py +++ b/pyblish/lib.py @@ -76,7 +76,7 @@ def extract_traceback(exception, fname=None): exception.traceback = (fname, lineno, func, msg) formatted_traceback = formatted_traceback.replace( 'File "", line ', - 'File "{0}", line'.format(fname)) + 'File "{0}", line '.format(fname)) exception.formatted_traceback = formatted_traceback del(exc_type, exc_value, exc_traceback) From f289f8144bb2cb2d0c675b8a523de8221b12fc6c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 2 Mar 2020 18:22:50 +0100 Subject: [PATCH 2/2] removed space at the end of replacement string during traceback formatting --- pyblish/lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyblish/lib.py b/pyblish/lib.py index 96780027..b94811bc 100644 --- a/pyblish/lib.py +++ b/pyblish/lib.py @@ -70,13 +70,13 @@ def extract_traceback(exception, fname=None): formatted_traceback = ''.join(traceback.format_exception( exc_type, exc_value, exc_traceback)) - if 'File "", line ' in formatted_traceback and fname is not None: + if 'File "", line' in formatted_traceback and fname is not None: _, lineno, func, msg = exception.traceback fname = os.path.abspath(fname) exception.traceback = (fname, lineno, func, msg) formatted_traceback = formatted_traceback.replace( - 'File "", line ', - 'File "{0}", line '.format(fname)) + 'File "", line', + 'File "{0}", line'.format(fname)) exception.formatted_traceback = formatted_traceback del(exc_type, exc_value, exc_traceback)