bluerobotics / tsys01-python

A Python module to interface with the TSYS01 temperature sensor.
MIT License
3 stars 12 forks source link

update __init__.py for python3 compatibility #11

Closed jaxxzer closed 3 years ago

jaxxzer commented 3 years ago

Fix #10

This breaks python2 import statements though (don't know why):

Python 2.7.16 (default, Oct 10 2019, 22:02:15) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tsys01
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python2.7/site-packages/tsys01/__init__.py", line 1, in <module>
    from tsys01.tsys01 import TSYS01
ImportError: No module named tsys01
jaxxzer commented 3 years ago

Isn´t the right fix doing from .tsys01 import TSYS01 ? Check the Python 3 Docs

yes, that works with both python2 and python3 thank you.