From d55b4f434f1884f375e553644e74080eb37c9ce1 Mon Sep 17 00:00:00 2001 From: Blazej Floch Date: Fri, 6 Sep 2019 11:00:24 -0400 Subject: [PATCH] Fixes the exception for some IDEs like PyCharm. --- src/rez/tests/util.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rez/tests/util.py b/src/rez/tests/util.py index 69411b8f4..ff344d7ca 100644 --- a/src/rez/tests/util.py +++ b/src/rez/tests/util.py @@ -178,10 +178,12 @@ def wrapper(self, *args, **kwargs): try: func(self, *args, **kwargs) except AssertionError as e: - # Add the shell to the exception message - args = list(e.args) - args[0] += " (in shell '{}')".format(shell) - e.args = tuple(args) + # Add the shell to the exception message, if possible. + # In some IDEs the args do not exist at all. + if e.args: + args = list(e.args) + args[0] += " (in shell '{}')".format(shell) + e.args = tuple(args) raise return wrapper return decorator