summaryrefslogtreecommitdiffstats
path: root/Tools/freeze
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-26 02:51:40 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-26 02:51:40 (GMT)
commit0f1e1fc3fa760d475a1c79c0dd081204bee00c10 (patch)
treedbd4b1cd7b00a0a819d5a9239718caa7e6dedcb5 /Tools/freeze
parent55b40b06d2cb3e6effd3aa663813923c4001ee66 (diff)
downloadcpython-0f1e1fc3fa760d475a1c79c0dd081204bee00c10.zip
cpython-0f1e1fc3fa760d475a1c79c0dd081204bee00c10.tar.gz
cpython-0f1e1fc3fa760d475a1c79c0dd081204bee00c10.tar.bz2
Don't die if win32api doesn't exist.
Diffstat (limited to 'Tools/freeze')
-rw-r--r--Tools/freeze/checkextensions_win32.py7
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))