Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This code does not work on python3 #7

Closed
brammittendorff opened this issue Aug 3, 2015 · 4 comments
Closed

This code does not work on python3 #7

brammittendorff opened this issue Aug 3, 2015 · 4 comments

Comments

@brammittendorff
Copy link

✔ ~/projects[master ↓·2|…2]
10:25 $ python3 get_urls.py
Traceback (most recent call last):
File "get_urls.py", line 4, in
from tomorrow import threads
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tomorrow/init.py", line 1, in
from tomorrow import threads
ImportError: cannot import name 'threads'
✔ ~/projects[master ↓·2|…2]
10:25 $ python get_urls.py
Time: 4.356341 seconds

@adrian17
Copy link

adrian17 commented Aug 3, 2015

For from tomorrow import threads to work, it probably would have to be contained in a single file (instead of a directory with __init__).

...or just change __init__ to from tomorrow.tomorrow import threads

By the way, tests also use Python2's print.

@madisonmay
Copy link
Owner

So oddly enough, it's non-trivial to port this code to Python 3. This is because I rely on old-style Python class behavior to ensure calls to __method__'s are intercepted. See https://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes for details.

@Slater-Victoroff
Copy link

2.7 is love, 2.7 is life.

@brammittendorff
Copy link
Author

Allright i will close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants