kdschlosser / UPNP_Device

Discovers UPNP devices on the network.
GNU Lesser General Public License v3.0
3 stars 1 forks source link

Python 3 compilation issue #12

Open raydog153 opened 5 years ago

raydog153 commented 5 years ago

How library is imported needs to be fixed. This is easy fix I can address later tonight.

rboutotte@MacBook-Pro-2:~/samsungtv/UPNP_Device$ python3 setup.py install
Traceback (most recent call last):
  File "/Users/rboutotte/samsungtv/UPNP_Device/UPNP_Device/upnp_class.py", line 8, in <module>
    urlparse = __import__('urlparse').urlparse
ModuleNotFoundError: No module named 'urlparse'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    import UPNP_Device
  File "/Users/rboutotte/samsungtv/UPNP_Device/UPNP_Device/__init__.py", line 14, in <module>
    from .listen import listen # NOQA
  File "/Users/rboutotte/samsungtv/UPNP_Device/UPNP_Device/listen.py", line 8, in <module>
    from .upnp_class import UPNPObject
  File "/Users/rboutotte/samsungtv/UPNP_Device/UPNP_Device/upnp_class.py", line 10, in <module>
    url_parse = __import__('urllib.parse').urlparse
AttributeError: module 'urllib' has no attribute 'urlparse'
raydog153 commented 5 years ago

Identified fix:

try:
    from urlparse import urlparse
except ImportError:
    from urllib.parse import urlparse