seb-m / pyinotify

Monitoring filesystems events with inotify on Linux.
http://github.com/seb-m/pyinotify/wiki
MIT License
2.29k stars 379 forks source link

Syntax Error while importing pyinotify in Python 3.5.3 #171

Open akumar38 opened 5 years ago

akumar38 commented 5 years ago

I have installed pyinotify. While importing pyinotify, i'm encountering a syntax error.

import pyinotify Traceback (most recent call last): File "", line 1, in File "", line 969, in _find_and_load File "", line 954, in _find_and_load_unlocked File "", line 896, in _find_spec File "", line 1152, in find_spec File "", line 1128, in _get_spec File "", line 1109, in _legacy_get_spec File "", line 444, in spec_from_loader File "", line 546, in spec_from_file_location File "/root/anaconda3/lib/python3.5/site-packages/pyinotify-0.9.6-py3.5.egg/pyinotify.py", line 179 except IOError, err: ^ SyntaxError: invalid syntax

can anyone suggest how to eliminate this error.

lromanov commented 5 years ago

It's python 2 exception handling syntax, should be except IOError as err: instead. Maybe you can make a pull request for that?