summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2015-12-16 08:16:58 (GMT)
committerDirk Baechle <dl9obn@darc.de>2015-12-16 08:16:58 (GMT)
commit8a198d3aa488dc02e77a87354a14fd6c5764184b (patch)
treec1abd0efd691153bcd74478e079aa5a92e214988
parent42ac4c63bd25680c49ff9a7fa6f1e1139d589ced (diff)
downloadSCons-8a198d3aa488dc02e77a87354a14fd6c5764184b.zip
SCons-8a198d3aa488dc02e77a87354a14fd6c5764184b.tar.gz
SCons-8a198d3aa488dc02e77a87354a14fd6c5764184b.tar.bz2
- fixed initialization of Util.WinError for Windows
-rw-r--r--src/engine/SCons/Util.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index cd23e6e..7bcd6e2 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -586,6 +586,10 @@ WinError = None
# OSError subclass on Windows.)
class PlainWindowsError(OSError):
pass
+try:
+ WinError = WindowsError
+except NameError:
+ WinError = PlainWindowsError
if can_read_reg:
@@ -621,11 +625,6 @@ if can_read_reg:
k = RegOpenKeyEx(root, keyp)
return RegQueryValueEx(k,val)
else:
- try:
- WinError = WindowsError
- except NameError:
- WinError = PlainWindowsError
-
HKEY_CLASSES_ROOT = None
HKEY_LOCAL_MACHINE = None
HKEY_CURRENT_USER = None