Closed lebeier closed 8 years ago
What's wrong with this code?
for people that are using python3, it seems that a pair of braces is required around multiple exceptions. The same error has been encountered by others, which they have suggested the work around to be adding braces. (refer to https://github.com/jazzband/django-pipeline/issues/476)
According to python3 documentation, parenthesized tuple is required for raising multiple exceptions.
This is a Python 2 backport of concurrent.futures and it's not even supposed to be installed on Python 3. Secondly, your suggested fix does not work on Python 3:
>>> raise (Exception, Exception('bah'), None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: exceptions must derive from BaseException
That is weird. Apparently, this is the package that is installed in my pip3. isn't futures-3.0.3 refers to this package? And adding the braces did remove the error encountered by people who are using the django-pipeline.
@lebeier No, you misunderstand. You do not, and should not install this package on Python 3. There is no need: concurrent.futures
is part of stdlib in those versions!
Edited to add: https://github.com/agronholm/pythonfutures/blob/master/setup.py#L32 < it's fairly indicated, too.
ARGHHH. thank you for the time to clarify with my misunderstanding with the issue.
The missing braces in line 357 raise type(self._exception), self._exception, self._traceback needs to be updated to raise (type(self._exception), self._exception, self._traceback)
This issue is causing django-pipeline to break as it depends on this package.