agronholm / pythonfutures

Backport of the concurrent.futures package to Python 2.6 and 2.7
Other
232 stars 51 forks source link

missing braces in concurrent/futures/_base.py #51

Closed lebeier closed 8 years ago

lebeier commented 8 years ago

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.

agronholm commented 8 years ago

What's wrong with this code?

lebeier commented 8 years ago

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.

agronholm commented 8 years ago

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
lebeier commented 8 years ago

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.

amcgregor commented 8 years ago

@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.

lebeier commented 8 years ago

ARGHHH. thank you for the time to clarify with my misunderstanding with the issue.