[pywin32-checkins] pywin32 setup.py,1.81,1.81.2.1
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-08-29 05:41:31
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2340 Modified Files: Tag: py3k setup.py Log Message: Changes for py3k, set all modules to UNICODE (still needs more work though) Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.81 retrieving revision 1.81.2.1 diff -C2 -d -r1.81 -r1.81.2.1 *** setup.py 9 Aug 2008 01:53:01 -0000 1.81 --- setup.py 29 Aug 2008 05:41:39 -0000 1.81.2.1 *************** *** 71,82 **** import types, glob import re ! import _winreg - # Python version compatibility hacks - try: - True; False - except NameError: - True=0==0 - False=1==0 # The rest of our imports. --- 71,76 ---- import types, glob import re ! import winreg # The rest of our imports. *************** *** 104,110 **** class Log: def debug(self, msg, *args): ! print msg % args def info(self, msg, *args): ! print msg % args log = Log() --- 98,104 ---- class Log: def debug(self, msg, *args): ! print (msg % args) def info(self, msg, *args): ! print (msg % args) log = Log() *************** *** 122,126 **** pywin32_version="%d.%d.%s" % (sys.version_info[0], sys.version_info[1], build_id_patch) ! print "Building pywin32", pywin32_version try: --- 116,120 ---- pywin32_version="%d.%d.%s" % (sys.version_info[0], sys.version_info[1], build_id_patch) ! print ("Building pywin32", pywin32_version) try: *************** *** 151,155 **** if sdkdir: if DEBUG: ! print "PSDK: try %MSSdk%: '%s'" % sdkdir if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir --- 145,149 ---- if sdkdir: if DEBUG: ! print ("PSDK: try %MSSdk%: '%s'" % sdkdir) if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir *************** *** 159,171 **** # the "Platform SDK for Windows Server 2003 SP1" this is dead end. try: ! key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\MicrosoftSDK\Directories") ! sdkdir, ignore = _winreg.QueryValueEx(key, "Install Dir") except EnvironmentError: pass else: if DEBUG: ! print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ ! "\Directories\Install Dir': '%s'" % sdkdir if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir --- 153,165 ---- # the "Platform SDK for Windows Server 2003 SP1" this is dead end. try: ! key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\MicrosoftSDK\Directories") ! sdkdir, ignore = winreg.QueryValueEx(key, "Install Dir") except EnvironmentError: pass else: if DEBUG: ! print (r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ ! "\Directories\Install Dir': '%s'" % sdkdir) if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir *************** *** 175,193 **** # only one with an "Install Dir" sub-value. try: ! key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\MicrosoftSDK\InstalledSDKs") i = 0 while True: ! guid = _winreg.EnumKey(key, i) ! guidkey = _winreg.OpenKey(key, guid) try: ! sdkdir, ignore = _winreg.QueryValueEx(guidkey, "Install Dir") except EnvironmentError: pass else: if DEBUG: ! print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ "\InstallSDKs\%s\Install Dir': '%s'"\ ! % (guid, sdkdir) if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir --- 169,187 ---- # only one with an "Install Dir" sub-value. try: ! key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\MicrosoftSDK\InstalledSDKs") i = 0 while True: ! guid = winreg.EnumKey(key, i) ! guidkey = winreg.OpenKey(key, guid) try: ! sdkdir, ignore = winreg.QueryValueEx(guidkey, "Install Dir") except EnvironmentError: pass else: if DEBUG: ! print (r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ "\InstallSDKs\%s\Install Dir': '%s'"\ ! % (guid, sdkdir)) if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir *************** *** 197,209 **** # 4. Vista's SDK try: ! key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\Microsoft SDKs\Windows") ! sdkdir, ignore = _winreg.QueryValueEx(key, "CurrentInstallFolder") except EnvironmentError: pass else: if DEBUG: ! print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDKs"\ ! "\Windows\CurrentInstallFolder': '%s'" % sdkdir if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir --- 191,203 ---- # 4. Vista's SDK try: ! key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\Microsoft SDKs\Windows") ! sdkdir, ignore = winreg.QueryValueEx(key, "CurrentInstallFolder") except EnvironmentError: pass else: if DEBUG: ! print (r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDKs"\ ! "\Windows\CurrentInstallFolder': '%s'" % sdkdir) if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir *************** *** 217,221 **** for sdkdir in defaultlocs: if DEBUG: ! print "PSDK: try default location: '%s'" % sdkdir if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir --- 211,215 ---- for sdkdir in defaultlocs: if DEBUG: ! print ("PSDK: try default location: '%s'" % sdkdir) if os.path.isfile(os.path.join(sdkdir, landmark)): return sdkdir *************** *** 293,302 **** result = [] for line in open(path).readlines(): ! line = string.rstrip(line) if line and line[0] in string.whitespace: ! tokens = string.split(line) ! if not tokens[0][0] in string.letters: continue ! result.append(string.join(tokens, ',')) return result --- 287,296 ---- result = [] for line in open(path).readlines(): ! line = line.rstrip() if line and line[0] in string.whitespace: ! tokens = line.split() ! if not tokens[0][0] in string.ascii_letters: continue ! result.append(','.join(tokens)) return result *************** *** 390,394 **** class WinExt_pythonwin(WinExt): def __init__ (self, name, **kw): ! if not kw.has_key("dsp_file") and not kw.get("sources"): kw["dsp_file"] = "pythonwin/" + name + ".dsp" kw.setdefault("extra_compile_args", []).extend( --- 384,388 ---- class WinExt_pythonwin(WinExt): def __init__ (self, name, **kw): ! if "dsp_file" not in kw and not kw.get("sources"): kw["dsp_file"] = "pythonwin/" + name + ".dsp" kw.setdefault("extra_compile_args", []).extend( *************** *** 400,404 **** class WinExt_win32(WinExt): def __init__ (self, name, **kw): ! if not kw.has_key("dsp_file") and not kw.get("sources"): kw["dsp_file"] = "win32/" + name + ".dsp" WinExt.__init__(self, name, **kw) --- 394,398 ---- class WinExt_win32(WinExt): def __init__ (self, name, **kw): ! if "dsp_file" not in kw and not kw.get("sources"): kw["dsp_file"] = "win32/" + name + ".dsp" WinExt.__init__(self, name, **kw) *************** *** 414,418 **** class WinExt_win32com(WinExt): def __init__ (self, name, **kw): ! if not kw.has_key("dsp_file") and not kw.get("sources"): kw["dsp_file"] = "com/" + name + ".dsp" kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32" --- 408,412 ---- class WinExt_win32com(WinExt): def __init__ (self, name, **kw): ! if "dsp_file" not in kw and not kw.get("sources"): kw["dsp_file"] = "com/" + name + ".dsp" kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32" *************** *** 437,445 **** libs = kw.get("libraries", "") keyname = "SOFTWARE\Microsoft\Exchange\SDK" ! for root in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER: try: ! keyob = _winreg.OpenKey(root, keyname) ! value, type_id = _winreg.QueryValueEx(keyob, "INSTALLDIR") ! if type_id == _winreg.REG_SZ: sdk_install_dir = value break --- 431,439 ---- libs = kw.get("libraries", "") keyname = "SOFTWARE\Microsoft\Exchange\SDK" ! for root in winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER: try: ! keyob = winreg.OpenKey(root, keyname) ! value, type_id = winreg.QueryValueEx(keyob, "INSTALLDIR") ! if type_id == winreg.REG_SZ: sdk_install_dir = value break *************** *** 479,484 **** f.write("%s\n" % build_id) f.close() ! except EnvironmentError, why: ! print "Failed to open '%s': %s" % (ver_fname, why) class my_build_ext(build_ext): --- 473,478 ---- f.write("%s\n" % build_id) f.close() ! except EnvironmentError as why: ! print ("Failed to open '%s': %s" % (ver_fname, why)) class my_build_ext(build_ext): *************** *** 632,636 **** break else: ! raise RuntimeError, "Can't find a version in Windows.h" if ext.windows_h_version > self.windows_h_version: return "WINDOWS.H with version 0x%x is required, but only " \ --- 626,630 ---- break else: ! raise RuntimeError("Can't find a version in Windows.h") if ext.windows_h_version > self.windows_h_version: return "WINDOWS.H with version 0x%x is required, but only " \ *************** *** 742,746 **** self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError, "Not a win32 package!" self.build_extension(ext) --- 736,740 ---- self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError("Not a win32 package!") self.build_extension(ext) *************** *** 751,755 **** self.excluded_extensions.append((ext, why)) assert why, "please give a reason, or None" ! print "Skipping %s: %s" % (ext.name, why) continue --- 745,749 ---- self.excluded_extensions.append((ext, why)) assert why, "please give a reason, or None" ! print ("Skipping %s: %s" % (ext.name, why)) continue *************** *** 757,761 **** self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError, "Not a win32 package!" self.build_exefile(ext) --- 751,755 ---- self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError("Not a win32 package!") self.build_exefile(ext) *************** *** 788,797 **** src = os.path.join(os.environ.get('SystemRoot'), 'System32', 'mfc71.dll') if not os.path.isfile(src): ! raise RuntimeError, "Can't find %r" % (src,) self.copy_file(src, target_dir) else: # On a 64bit host, the value we are looking for is actually in # SysWow64Node - but that is only available on xp and later. ! access = _winreg.KEY_READ if sys.getwindowsversion()[0] >= 5: access = access | 512 # KEY_WOW64_32KEY --- 782,791 ---- src = os.path.join(os.environ.get('SystemRoot'), 'System32', 'mfc71.dll') if not os.path.isfile(src): ! raise RuntimeError("Can't find %r" % (src,)) self.copy_file(src, target_dir) else: # On a 64bit host, the value we are looking for is actually in # SysWow64Node - but that is only available on xp and later. ! access = winreg.KEY_READ if sys.getwindowsversion()[0] >= 5: access = access | 512 # KEY_WOW64_32KEY *************** *** 801,817 **** plat_dir = "x86" # Find the redist directory. ! vckey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", access) ! val, val_typ = _winreg.QueryValueEx(vckey, "ProductDir") mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") if not os.path.isdir(mfc_dir): ! raise RuntimeError, "Can't find the redist dir at %r" % (mfc_dir) files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() for f in files: self.copy_file( os.path.join(mfc_dir, f), target_dir) ! except (EnvironmentError, RuntimeError), exc: ! print "Can't find an installed VC for the MFC DLLs:", exc --- 795,811 ---- plat_dir = "x86" # Find the redist directory. ! vckey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", access) ! val, val_typ = winreg.QueryValueEx(vckey, "ProductDir") mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") if not os.path.isdir(mfc_dir): ! raise RuntimeError("Can't find the redist dir at %r" % (mfc_dir)) files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() for f in files: self.copy_file( os.path.join(mfc_dir, f), target_dir) ! except (EnvironmentError, RuntimeError) as exc: ! print ("Can't find an installed VC for the MFC DLLs:", exc) *************** *** 820,827 **** sources = ext.sources if sources is None or type(sources) not in (ListType, TupleType): ! raise DistutilsSetupError, \ ("in 'ext_modules' option (extension '%s'), " + "'sources' must be present and must be " + ! "a list of source filenames") % ext.name sources = list(sources) --- 814,821 ---- sources = ext.sources if sources is None or type(sources) not in (ListType, TupleType): ! raise DistutilsSetupError( ("in 'ext_modules' option (extension '%s'), " + "'sources' must be present and must be " + ! "a list of source filenames") % ext.name) sources = list(sources) *************** *** 940,944 **** self.excluded_extensions.append((ext, why)) assert why, "please give a reason, or None" ! print "Skipping %s: %s" % (ext.name, why) return self.current_extension = ext --- 934,938 ---- self.excluded_extensions.append((ext, why)) assert why, "please give a reason, or None" ! print ("Skipping %s: %s" % (ext.name, why)) return self.current_extension = ext *************** *** 995,1000 **** elif name.endswith("win32.perfmondata"): return r"win32\perfmondata" + extra_dll - elif name.endswith("win32.win32popenWin9x"): - return r"win32\win32popenWin9x" + extra_exe elif name.endswith("win32.pythonservice"): return r"win32\pythonservice" + extra_exe --- 989,992 ---- *************** *** 1114,1118 **** # process so the child will wait for us. # XXX - hmm - a closer look at distutils shows it only uses win32api ! # if _winreg fails - and this never should. Need to revisit this! # If self.root has a value, it means we are being "installed" into # some other directory than Python itself (eg, into a temp directory --- 1106,1110 ---- # process so the child will wait for us. # XXX - hmm - a closer look at distutils shows it only uses win32api ! # if winreg fails - and this never should. Need to revisit this! # If self.root has a value, it means we are being "installed" into # some other directory than Python itself (eg, into a temp directory *************** *** 1123,1128 **** filename = os.path.join(os.path.dirname(this_file), "pywin32_postinstall.py") if not os.path.isfile(filename): ! raise RuntimeError, "Can't find '%s'" % (filename,) ! print "Executing post install script..." os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, filename, --- 1115,1120 ---- filename = os.path.join(os.path.dirname(this_file), "pywin32_postinstall.py") if not os.path.isfile(filename): ! raise RuntimeError("Can't find '%s'" % (filename,)) ! print ("Executing post install script...") os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, filename, *************** *** 1135,1139 **** # (otherwise we replace all of build_extension!) def my_new_compiler(**kw): ! if kw.has_key('compiler') and kw['compiler'] in (None, 'msvc'): return my_compiler() return orig_new_compiler(**kw) --- 1127,1131 ---- # (otherwise we replace all of build_extension!) def my_new_compiler(**kw): ! if 'compiler' in kw and kw['compiler'] in (None, 'msvc'): return my_compiler() return orig_new_compiler(**kw) *************** *** 1221,1225 **** try: self.spawn(args) ! except DistutilsExecError, msg: log.info("VersionStamp failed: %s", msg) ok = False --- 1213,1217 ---- try: self.spawn(args) ! except DistutilsExecError as msg: log.info("VersionStamp failed: %s", msg) ok = False *************** *** 1261,1265 **** installobj = self.distribution.get_command_obj('install') self.install_dir = installobj.install_lib ! print 'Installing data files to %s' % self.install_dir install_data.finalize_options(self) --- 1253,1257 ---- installobj = self.distribution.get_command_obj('install') self.install_dir = installobj.install_lib ! print ('Installing data files to %s' % self.install_dir) install_data.finalize_options(self) *************** *** 1285,1304 **** for info in ( ! ("dbi", "", False), ! ("mmapfile", "", False), ! ("odbc", "odbc32 odbccp32 dbi", False), ("perfmon", "", True), ! ("timer", "user32", False), ! ("win2kras", "rasapi32", False, 0x0500), ! ("win32api", "user32 advapi32 shell32 version", False, 0x0500, 'win32/src/win32apimodule.cpp win32/src/win32api_display.cpp'), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ! ("win32crypt", "Crypt32", False, 0x0500, 'win32/src/win32crypt.i win32/src/win32cryptmodule.cpp'), ! ("win32file", "oleaut32", False, 0x0500), ! ("win32event", "user32", False), ! ("win32clipboard", "gdi32 user32 shell32", False), ! ("win32evtlog", "advapi32 oleaut32", False), # win32gui handled below ! ("win32job", "user32", False, 0x0500, 'win32/src/win32job.i win32/src/win32jobmodule.cpp'), ! ("win32lz", "lz32", False), ("win32net", "netapi32 advapi32", True, None, """ win32/src/win32net/win32netfile.cpp win32/src/win32net/win32netgroup.cpp --- 1277,1296 ---- for info in ( ! ("dbi", "", True), ! ("mmapfile", "", True), ! ("odbc", "odbc32 odbccp32 dbi", True), ("perfmon", "", True), ! ("timer", "user32", True), ! ("win2kras", "rasapi32", True, 0x0500), ! ("win32api", "user32 advapi32 shell32 version", True, 0x0500, 'win32/src/win32apimodule.cpp win32/src/win32api_display.cpp'), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ! ("win32crypt", "Crypt32", True, 0x0500, 'win32/src/win32crypt.i win32/src/win32cryptmodule.cpp'), ! ("win32file", "oleaut32", True, 0x0500), ! ("win32event", "user32", True), ! ("win32clipboard", "gdi32 user32 shell32", True), ! ("win32evtlog", "advapi32 oleaut32", True), # win32gui handled below ! ("win32job", "user32", True, 0x0500, 'win32/src/win32job.i win32/src/win32jobmodule.cpp'), ! ("win32lz", "lz32", True), ("win32net", "netapi32 advapi32", True, None, """ win32/src/win32net/win32netfile.cpp win32/src/win32net/win32netgroup.cpp *************** *** 1307,1316 **** win32/src/win32net/win32netuser.cpp """), ! ("win32pdh", "", False), ! ("win32pipe", "", False), ! ("win32print", "winspool user32 gdi32", False, 0x0500), ! ("win32process", "advapi32 user32", False, 0x0500), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), ! ("win32ras", "rasapi32 user32", False), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ win32/src/win32security.i win32/src/win32securitymodule.cpp --- 1299,1308 ---- win32/src/win32net/win32netuser.cpp """), ! ("win32pdh", "", True), ! ("win32pipe", "", True), ! ("win32print", "winspool user32 gdi32", True, 0x0500), ! ("win32process", "advapi32 user32", True, 0x0500), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), ! ("win32ras", "rasapi32 user32", True), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ win32/src/win32security.i win32/src/win32securitymodule.cpp *************** *** 1318,1324 **** """), ("win32service", "advapi32 oleaut32 user32", True, 0x0501), ! ("win32trace", "advapi32", False), ! ("win32wnet", "netapi32 mpr", False), ! ("win32inet", "wininet", False, 0x500, """ win32/src/win32inet.i win32/src/win32inetmodule.cpp win32/src/win32inet_winhttp.cpp""" --- 1310,1316 ---- """), ("win32service", "advapi32 oleaut32 user32", True, 0x0501), ! ("win32trace", "advapi32", True), ! ("win32wnet", "netapi32 mpr", True), ! ("win32inet", "wininet", True, 0x500, """ win32/src/win32inet.i win32/src/win32inetmodule.cpp win32/src/win32inet_winhttp.cpp""" *************** *** 1326,1330 **** ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("win32ts", "WtsApi32", True, 0x0501, "win32/src/win32tsmodule.cpp"), ! ("_win32sysloader", "", False, 0x0501, "win32/src/_win32sysloader.cpp"), ("win32transaction", "kernel32", True, 0x0501, "win32/src/win32transactionmodule.cpp"), --- 1318,1322 ---- ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("win32ts", "WtsApi32", True, 0x0501, "win32/src/win32tsmodule.cpp"), ! ("_win32sysloader", "", True, 0x0501, "win32/src/_win32sysloader.cpp"), ("win32transaction", "kernel32", True, 0x0501, "win32/src/win32transactionmodule.cpp"), *************** *** 1357,1360 **** --- 1349,1353 ---- libraries="gdi32 user32 comdlg32 comctl32 shell32", define_macros = [("WIN32GUI", None)], + extra_compile_args = ['-DUNICODE', '-D_UNICODE'] ), # winxpgui is built from win32gui.i, but sets up different #defines before *************** *** 1369,1372 **** --- 1362,1366 ---- define_macros = [("WIN32GUI",None), ("WINXPGUI",None)], extra_swig_commands=["-DWINXPGUI"], + extra_compile_args = ['-DUNICODE', '-D_UNICODE'] ), # winxptheme *************** *** 1457,1466 **** # ActiveDebugging is a mess. See the comments in the docstring of this # module for details on getting it built. ! WinExt_win32com('axdebug', ! dsp_file=r"com\Active Debugging.dsp", ! libraries="axscript", ! pch_header = "stdafx.h", ! optional_headers = ["activdbg.h"], ! ), WinExt_win32com('internet'), WinExt_win32com('mapi', libraries="mapi32", pch_header="PythonCOM.h", --- 1451,1460 ---- # ActiveDebugging is a mess. See the comments in the docstring of this # module for details on getting it built. ! ## WinExt_win32com('axdebug', ! ## dsp_file=r"com\Active Debugging.dsp", ! ## libraries="axscript", ! ## pch_header = "stdafx.h", ! ## optional_headers = ["activdbg.h"], ! ## ), WinExt_win32com('internet'), WinExt_win32com('mapi', libraries="mapi32", pch_header="PythonCOM.h", *************** *** 1628,1634 **** W32_exe_files = [ - WinExt_win32("win32popenWin9x", - libraries = "user32", - platforms = ["win32"]), WinExt_win32("pythonservice", dsp_file = "win32/PythonService EXE.dsp", --- 1622,1625 ---- *************** *** 1711,1719 **** flist.exclude_pattern(re.compile(".*\\\\\."), is_regex=1) if not flist.files: ! raise RuntimeError, "No files match '%s'" % file files_use = flist.files else: if not os.path.isfile(file): ! raise RuntimeError, "No file '%s'" % file files_use = (file,) for fname in files_use: --- 1702,1710 ---- flist.exclude_pattern(re.compile(".*\\\\\."), is_regex=1) if not flist.files: ! raise RuntimeError("No files match '%s'" % file) files_use = flist.files else: if not os.path.isfile(file): ! raise RuntimeError("No file '%s'" % file) files_use = (file,) for fname in files_use: *************** *** 1729,1734 **** try: temp = convert_data_files([file]) ! except RuntimeError, details: ! if not str(details).startswith("No file"): raise log.info('NOTE: Optional file %s not found - skipping' % file) --- 1720,1725 ---- try: temp = convert_data_files([file]) ! except RuntimeError as details: ! if not str(details.args[0]).startswith("No file"): raise log.info('NOTE: Optional file %s not found - skipping' % file) *************** *** 1740,1745 **** if len(sys.argv)==1: # distutils will print usage - print our docstring first. ! print __doc__ ! print "Standard usage information follows:" packages=['win32com', --- 1731,1736 ---- if len(sys.argv)==1: # distutils will print usage - print our docstring first. ! print (__doc__) ! print ("Standard usage information follows:") packages=['win32com', *************** *** 1914,1922 **** excluded_extensions = dist.command_obj['build_ext'].excluded_extensions if excluded_extensions: ! print "*** NOTE: The following extensions were NOT %s:" % what_string for ext, why in excluded_extensions: ! print " %s: %s" % (ext.name, why) ! print "For more details on installing the correct libraries and headers," ! print "please execute this script with no arguments (or see the docstring)" else: ! print "All extension modules %s OK" % (what_string,) --- 1905,1913 ---- excluded_extensions = dist.command_obj['build_ext'].excluded_extensions if excluded_extensions: ! print ("*** NOTE: The following extensions were NOT %s:" % what_string) for ext, why in excluded_extensions: ! print (" %s: %s" % (ext.name, why)) ! print ("For more details on installing the correct libraries and headers,") ! print ("please execute this script with no arguments (or see the docstring)") else: ! print ("All extension modules %s OK" % (what_string,)) |