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

Python 3.9 SyntaxError #204

Closed
souellet-ms opened this issue Oct 13, 2020 · 3 comments
Closed

Python 3.9 SyntaxError #204

souellet-ms opened this issue Oct 13, 2020 · 3 comments
Labels

Comments

@souellet-ms
Copy link

souellet-ms commented Oct 13, 2020

Using digi-xbee with Python 3.9 (release October 5th, 2020) gives the following error. digi-xbee works fine with Python 3.8

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\...\venv\lib\site-packages\digi\xbee\devices.py", line 22, in <module>
    from digi.xbee import serial
  File "C:\...\venv\lib\site-packages\digi\xbee\serial.py", line 21, in <module>
    from digi.xbee.models.mode import OperatingMode
  File "C:\...\venv\lib\site-packages\digi\xbee\models\mode.py", line 230
    return sum(op.code for op in options if lambda option: (option != cls.EXPLICIT))
                                            ^
SyntaxError: invalid syntax
python-BaseException
@tirkarthi
Copy link

This is due to new parser which was closed as not fixed in https://bugs.python.org/issue41848 . lambda is always evaluated as true so this is a bug that needs to be fixed in the code.

tatianaleon added a commit that referenced this issue Oct 14, 2020
#204

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
@tatianaleon
Copy link
Contributor

Hi @souellet-ms,

Thanks for reporting this issue. We have just fixed it in master (see commit ddbff36) and will be included in the next release.

In the meantime, you can download the source code from the master branch and install the library from there (see instructions at https://github.com/digidotcom/python-xbee/blob/master/README.rst#install-from-source).

Sorry for the inconvenience.

Best regards.

@traverseda
Copy link

When is the next release? Waiting on this fix.

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

No branches or pull requests

4 participants