diff options
author | Sebastien Martini <seb@dbzteam.org> | 2010-07-30 14:29:47 +0200 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2010-07-30 14:29:47 +0200 |
commit | 5fe8449aac44408abdc183289678a3e5d4065980 (patch) | |
tree | f034c45157ab06ded3f32f949643506631f41ba6 | |
parent | 7d2110a39847512c98533cc5237d3795d31eeb73 (diff) | |
download | pyinotify-5fe8449aac44408abdc183289678a3e5d4065980.tar.gz |
Reverted exception name of libc loading error, back to
UnsupportedLibcVersionError.
-rwxr-xr-x | python2/pyinotify.py | 12 | ||||
-rwxr-xr-x | python3/pyinotify.py | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py index b5f420a..56ce8cb 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -47,7 +47,7 @@ class UnsupportedPythonVersionError(PyinotifyError): 'at least Python 2.4') % version) -class LibcError(PyinotifyError): +class UnsupportedLibcVersionError(PyinotifyError): """ Raised when libc couldn't be loaded or when inotify functions werent provided. @@ -110,27 +110,27 @@ def load_libc(): global strerrno global LIBC - l = None + libc = None try: - l = ctypes.util.find_library('c') + libc = ctypes.util.find_library('c') except (OSError, IOError): pass # Will attemp to load it with None anyway. if sys.version_info[0] >= 2 and sys.version_info[1] >= 6: - LIBC = ctypes.CDLL(l, use_errno=True) + LIBC = ctypes.CDLL(libc, use_errno=True) def _strerrno(): code = ctypes.get_errno() return ' Errno=%s (%s)' % (os.strerror(code), errno.errorcode[code]) strerrno = _strerrno else: - LIBC = ctypes.CDLL(l) + LIBC = ctypes.CDLL(libc) strerrno = lambda : '' # Check that libc has needed functions inside. if (not hasattr(LIBC, 'inotify_init') or not hasattr(LIBC, 'inotify_add_watch') or not hasattr(LIBC, 'inotify_rm_watch')): - raise LibcError() + raise UnsupportedLibcVersionError() load_libc() diff --git a/python3/pyinotify.py b/python3/pyinotify.py index 5cd6831..467a521 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -47,7 +47,7 @@ class UnsupportedPythonVersionError(PyinotifyError): 'at least Python 3.0') % version) -class LibcError(PyinotifyError): +class UnsupportedLibcVersionError(PyinotifyError): """ Raised when libc couldn't be loaded or when inotify functions werent provided. @@ -110,21 +110,21 @@ def strerrno(): def load_libc(): global LIBC - l = None + libc = None try: - l = ctypes.util.find_library('c') + libc = ctypes.util.find_library('c') except OSError as err: pass # Will attemp to load it with None anyway. except IOError as err: pass - LIBC = ctypes.CDLL(l, use_errno=True) + LIBC = ctypes.CDLL(libc, use_errno=True) # Check that libc has needed functions inside. if (not hasattr(LIBC, 'inotify_init') or not hasattr(LIBC, 'inotify_add_watch') or not hasattr(LIBC, 'inotify_rm_watch')): - raise LibcError() + raise UnsupportedLibcVersionError() load_libc() |