mirror of https://gitlab.com/ita1024/waf.git
Error handling simplifications
This commit is contained in:
parent
76c9d3356b
commit
201118736e
|
@ -185,10 +185,7 @@ def setup_ifort(conf, versions, arch = False):
|
||||||
cfg.evaluate()
|
cfg.evaluate()
|
||||||
if cfg.is_valid:
|
if cfg.is_valid:
|
||||||
compiler,revision = version.rsplit(' ', 1)
|
compiler,revision = version.rsplit(' ', 1)
|
||||||
p1 = cfg.bindirs
|
return compiler,revision,cfg.bindirs,cfg.incdirs,cfg.libdirs,cfg.cpu
|
||||||
p2 = cfg.incdirs
|
|
||||||
p3 = cfg.libdirs
|
|
||||||
return compiler,revision,p1,p2,p3,cfg.cpu
|
|
||||||
|
|
||||||
conf.fatal('msvc: Impossible to find a valid architecture for building (in setup_ifort)')
|
conf.fatal('msvc: Impossible to find a valid architecture for building (in setup_ifort)')
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,7 @@ def setup_msvc(conf, versions, arch=False):
|
||||||
cfg.evaluate()
|
cfg.evaluate()
|
||||||
if cfg.is_valid:
|
if cfg.is_valid:
|
||||||
compiler,revision = version.rsplit(' ', 1)
|
compiler,revision = version.rsplit(' ', 1)
|
||||||
p1 = cfg.bindirs
|
return compiler,revision,cfg.bindirs,cfg.incdirs,cfg.libdirs,cfg.cpu
|
||||||
p2 = cfg.incdirs
|
|
||||||
p3 = cfg.libdirs
|
|
||||||
return compiler,revision,p1,p2,p3,cfg.cpu
|
|
||||||
conf.fatal('msvc: Impossible to find a valid architecture for building (in setup_msvc)')
|
conf.fatal('msvc: Impossible to find a valid architecture for building (in setup_msvc)')
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
|
@ -280,19 +277,19 @@ def gather_wince_supported_platforms():
|
||||||
while 1:
|
while 1:
|
||||||
try:
|
try:
|
||||||
sdk_device = Utils.winreg.EnumKey(ce_sdk, ce_index)
|
sdk_device = Utils.winreg.EnumKey(ce_sdk, ce_index)
|
||||||
|
sdk = Utils.winreg.OpenKey(ce_sdk, sdk_device)
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
break
|
break
|
||||||
ce_index += 1
|
ce_index += 1
|
||||||
sdk = Utils.winreg.OpenKey(ce_sdk, sdk_device)
|
|
||||||
try:
|
try:
|
||||||
path,type = Utils.winreg.QueryValueEx(sdk, 'SDKRootDir')
|
path,type = Utils.winreg.QueryValueEx(sdk, 'SDKRootDir')
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
try:
|
try:
|
||||||
path,type = Utils.winreg.QueryValueEx(sdk,'SDKInformation')
|
path,type = Utils.winreg.QueryValueEx(sdk,'SDKInformation')
|
||||||
path,xml = os.path.split(path)
|
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
continue
|
continue
|
||||||
path=str(path)
|
path,xml = os.path.split(path)
|
||||||
|
path = str(path)
|
||||||
path,device = os.path.split(path)
|
path,device = os.path.split(path)
|
||||||
if not device:
|
if not device:
|
||||||
path,device = os.path.split(path)
|
path,device = os.path.split(path)
|
||||||
|
@ -309,12 +306,12 @@ def gather_msvc_detected_versions():
|
||||||
version_pattern = re.compile('^(\d\d?\.\d\d?)(Exp)?$')
|
version_pattern = re.compile('^(\d\d?\.\d\d?)(Exp)?$')
|
||||||
detected_versions = []
|
detected_versions = []
|
||||||
for vcver,vcvar in (('VCExpress','Exp'), ('VisualStudio','')):
|
for vcver,vcvar in (('VCExpress','Exp'), ('VisualStudio','')):
|
||||||
|
prefix = 'SOFTWARE\\Wow6432node\\Microsoft\\' + vcver
|
||||||
try:
|
try:
|
||||||
prefix = 'SOFTWARE\\Wow6432node\\Microsoft\\'+vcver
|
|
||||||
all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, prefix)
|
all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, prefix)
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
|
prefix = 'SOFTWARE\\Microsoft\\' + vcver
|
||||||
try:
|
try:
|
||||||
prefix = 'SOFTWARE\\Microsoft\\'+vcver
|
|
||||||
all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, prefix)
|
all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, prefix)
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue