From 9d5259987e5c11a930420affba7ef309eff9b69f Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Thu, 3 Jun 2021 13:49:51 +0000 Subject: [PATCH] Stop using exception.message https://bugzilla.mozilla.org/show_bug.cgi?id=1713825#c0 > In PEP 352, exception.message was deprecated (now, you can get the string from of an exception by simply doing str(exception). As of Python 3.0, exception.message was dropped, and attempting to access it causes an error. --- pyrsistent/_immutable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrsistent/_immutable.py b/pyrsistent/_immutable.py index 66060d0..7c75945 100644 --- a/pyrsistent/_immutable.py +++ b/pyrsistent/_immutable.py @@ -98,6 +98,6 @@ def set(self, **kwargs): try: exec(template, namespace) except SyntaxError as e: - raise SyntaxError(e.message + ':\n' + template) from e + raise SyntaxError(str(e) + ':\n' + template) from e return namespace[name]