Skip to content

Commit 5ecc50e

Browse files
committed
Avoid invalid syntax warning when installing with Python3
1 parent 903dcbe commit 5ecc50e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

easybuild/tools/py2vs3/py2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ def subprocess_popen_text(cmd, **kwargs):
5757
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
5858

5959

60+
# Wrapped in exec to avoid invalid syntax warnings for Python 3
61+
exec('''
6062
def raise_with_traceback(exception_class, message, traceback):
6163
"""Raise exception of specified class with given message and traceback."""
6264
raise exception_class, message, traceback # noqa: E999
65+
''')
6366

6467

6568
def extract_method_name(method_func):

0 commit comments

Comments
 (0)