[Python-Dev] Proposed Python api for testing whether a module exists (original) (raw)
Tim Peters tim.peters at gmail.com
Mon Aug 2 19:15:20 CEST 2004
- Previous message: [Python-Dev] Re: Proposed Python api for testing whether a module exists
- Next message: [Python-Dev] Proposed Python api for testing whether a module exists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Jim Fulton]
I propose to add the following function to the imp module:
exists(modulename) Test whether the named module can be found.
+1. This can be much better than catching ImportError, for reasons previously given. site.py should be changed to use this to determine whether sitecustomize exists (as is, if sitecustomize exists but screws up by trying to import something that isn't on sys.path, site.py suppresses the ImportError raised by sitecustomize; this is bad).
- Previous message: [Python-Dev] Re: Proposed Python api for testing whether a module exists
- Next message: [Python-Dev] Proposed Python api for testing whether a module exists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]