diff options
author | Guido van Rossum <guido@python.org> | 1998-05-26 02:51:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-05-26 02:51:40 (GMT) |
commit | 0f1e1fc3fa760d475a1c79c0dd081204bee00c10 (patch) | |
tree | dbd4b1cd7b00a0a819d5a9239718caa7e6dedcb5 /Tools/freeze/checkextensions_win32.py | |
parent | 55b40b06d2cb3e6effd3aa663813923c4001ee66 (diff) | |
download | cpython-0f1e1fc3fa760d475a1c79c0dd081204bee00c10.zip cpython-0f1e1fc3fa760d475a1c79c0dd081204bee00c10.tar.gz cpython-0f1e1fc3fa760d475a1c79c0dd081204bee00c10.tar.bz2 |
Don't die if win32api doesn't exist.
Diffstat (limited to 'Tools/freeze/checkextensions_win32.py')
-rw-r--r-- | Tools/freeze/checkextensions_win32.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/freeze/checkextensions_win32.py b/Tools/freeze/checkextensions_win32.py index 10bd3ef..69643b3 100644 --- a/Tools/freeze/checkextensions_win32.py +++ b/Tools/freeze/checkextensions_win32.py @@ -20,7 +20,11 @@ At the moment the name and location of this INI file is hardcoded, but an obvious enhancement would be to provide command line options. """ -import os, win32api, string, sys +import os, string, sys +try: + import win32api +except ImportError: + win32api = None # User has already been warned class CExtension: """An abstraction of an extension implemented in C/C++ @@ -60,6 +64,7 @@ def checkextensions(unknown, ignored): return ret def get_extension_defn(moduleName, mapFileName): + if win32api is None: return None dsp = win32api.GetProfileVal(moduleName, "dsp", "", mapFileName) if dsp=="": sys.stderr.write("No definition of module %s in map file '%s'\n" % (moduleName, mapFileName)) |