vpelletier / python-libusb1

Python ctype-based wrapper around libusb1
GNU Lesser General Public License v2.1
174 stars 67 forks source link

Fix syntax error for python3.8 #55

Closed csouers closed 4 years ago

csouers commented 4 years ago

Is this the desired change?

vpelletier commented 4 years ago

Nice catch, these examples are indeed not regularly tested, and this was archaic (python <=2.6) syntax that python 3 rightly rejects.

The fix is actually to change the comma into an as: this code is trying to display the error which happened before exiting. Otherwise, this will just cause a NameError as exc will not be set.

Do you want to amend this commit ? If so, please make the commit message first line something like examples/hotplug_advanced.py: Fix syntax for python 3 or similar.

Otherwise, I will apply this fix, and try to find a way to get these examples to at least be checked for syntax in automated tests.

csouers commented 4 years ago

See latest rebase. (sorry for the close and reopen)

vpelletier commented 4 years ago

Thanks for the updated commit, it is now merged.