Rearrange trys to avoid possible undefined vars.

pull/1810/head
Elliott Sales de Andrade 8 years ago
parent f8fe9939e4
commit 83d1c7f063
  1. 2
      mesonbuild/environment.py
  2. 5
      mesonbuild/wrap/wrap.py
  3. 2
      mesontest.py

@ -459,11 +459,11 @@ class Environment:
for compiler in compilers:
if isinstance(compiler, str):
compiler = [compiler]
try:
if 'cl' in compiler or 'cl.exe' in compiler:
arg = '/?'
else:
arg = '--version'
try:
p, out, err = Popen_safe(compiler + [arg])
except OSError as e:
popen_exceptions[' '.join(compiler + [arg])] = e

@ -301,12 +301,13 @@ class Resolver:
try:
import lzma
del lzma
except ImportError:
pass
else:
try:
shutil.register_unpack_format('xztar', ['.tar.xz', '.txz'], shutil._unpack_tarfile, [], "xz'ed tar-file")
except shutil.RegistryError:
pass
except ImportError:
pass
target_dir = os.path.join(self.subdir_root, package.get('directory'))
if os.path.isdir(target_dir):
return

@ -457,11 +457,11 @@ TIMEOUT: %4d
return test.name
def run_tests(self, tests):
try:
executor = None
logfile = None
jsonlogfile = None
futures = []
try:
numlen = len('%d' % len(tests))
(logfile, logfilename, jsonlogfile, jsonlogfilename) = self.open_log_files()
wrap = self.get_wrapper()

Loading…
Cancel
Save