Skip to content

Conversation

@clorenz7
Copy link

@clorenz7 clorenz7 commented Mar 20, 2018

Not sure if this is a backwards compatibility issue:

Python 2.7.9 (default, Apr  2 2015, 15:35:35) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests.get as urlopen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named get
>>> from requests import get as urlopen
>>> 

I think because the get function lives at requests.api
https://github.com/requests/requests/blob/master/requests/__init__.py#L115

I also saw this with python3.4

Not sure if this is a backwards compatibility issue. 
```
Python 2.7.9 (default, Apr  2 2015, 15:35:35) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests.get as urlopen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named get
>>> from requests import get as urlopen
>>> 
```
@apaszke apaszke merged commit 21ce93e into pytorch:master Mar 20, 2018
@apaszke
Copy link
Contributor

apaszke commented Mar 20, 2018

Thanks!

apaszke added a commit that referenced this pull request Mar 20, 2018
apaszke added a commit that referenced this pull request Mar 20, 2018
jekbradbury pushed a commit to jekbradbury/pytorch that referenced this pull request Mar 21, 2018
Not sure if this is a backwards compatibility issue. 
```
Python 2.7.9 (default, Apr  2 2015, 15:35:35) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests.get as urlopen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named get
>>> from requests import get as urlopen
>>> 
```
jekbradbury pushed a commit to jekbradbury/pytorch that referenced this pull request Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants