denisenkom / pytwain

TWAIN library using ctypes bindings
Other
46 stars 23 forks source link

Change ImportError to NotFoundModule #24

Closed macielti closed 4 years ago

macielti commented 4 years ago

Changed the ImportError exception to NotFoundModule what is python3 compatible.

Now you are abble to run the demo/scan.py script with no problems when using python3.

denisenkom commented 4 years ago

ImportError class is present in all versions of Python, including latest: https://docs.python.org/3.9/library/exceptions.html#ImportError ModuleNotFoundError is present only in 3.6 and later. Also ModuleNotFoundError is a subclass of ImportError, so ImportError would also catch ModuleNotFoundError.

Can you explain why do you think this change is necessary?

macielti commented 4 years ago

When i tried to run the demo/scan.py on a Windows 7 32bits with Python 3.7.5 produces the following error:

Drag Racing

The pull request changes solved the problem.

denisenkom commented 4 years ago

Line numbers don't match in your error message with source code. You probably have older version. Can you try latest version from github?

macielti commented 4 years ago

Yes. With a new fresh install of python 3.7.5 32bits on Windows 7 32bits: