aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-12-19 21:05:09 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-20 00:07:00 +0200
commit9bc07a09412b6ea1ff5e558e97478941b6cbfd18 (patch)
treecde770ae4dfff10f35adcde343050393a03477f8 /mesonbuild/environment.py
parentb4cead2763460d11ed3a6f467618f65716021bd2 (diff)
downloadmeson-9bc07a09412b6ea1ff5e558e97478941b6cbfd18.zip
meson-9bc07a09412b6ea1ff5e558e97478941b6cbfd18.tar.gz
meson-9bc07a09412b6ea1ff5e558e97478941b6cbfd18.tar.bz2
Fix several more lint errors
Found by Igor Gnatenko ************* Module mesonbuild.interpreter E:1232,33: No value for argument 'interp' in constructor call (no-value-for-parameter) ************* Module mesonbuild.dependencies E: 68, 4: An attribute defined in mesonbuild.dependencies line 39 hides this method (method-hidden) ************* Module mesonbuild.environment E: 26, 0: class already defined line 19 (function-redefined) E: 68,18: Undefined variable 'InterpreterException' (undefined-variable) E:641,39: Undefined variable 'want_cross' (undefined-variable) E:850,94: Undefined variable 'varname' (undefined-variable) E:854,94: Undefined variable 'varname' (undefined-variable) E:860,102: Undefined variable 'varname' (undefined-variable) E:863,94: Undefined variable 'varname' (undefined-variable) ************* Module mesonbuild.modules.gnome E:438,26: Undefined variable 'compilers' (undefined-variable)
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 3231fa8..52f5752 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -17,16 +17,12 @@ from . import coredata
from . import mesonlib
from . import mlog
from .compilers import *
-from .mesonlib import Popen_safe
+from .mesonlib import EnvironmentException, Popen_safe
import configparser
import shutil
build_filename = 'meson.build'
-class EnvironmentException(mesonlib.MesonException):
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
-
def find_coverage_tools():
gcovr_exe = 'gcovr'
lcov_exe = 'lcov'
@@ -65,7 +61,7 @@ def detect_native_windows_arch():
# If this doesn't exist, something is messing with the environment
arch = os.environ['PROCESSOR_ARCHITECTURE'].lower()
except KeyError:
- raise InterpreterException('Unable to detect native OS architecture')
+ raise EnvironmentException('Unable to detect native OS architecture')
return arch
def detect_windows_arch(compilers):
@@ -629,7 +625,7 @@ class Environment():
return RustCompiler(exelist, version)
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
- def detect_d_compiler(self):
+ def detect_d_compiler(self, want_cross):
exelist = None
is_cross = False
# Search for a D compiler.
@@ -847,20 +843,20 @@ class CrossBuildInfo():
for entry in config[s]:
value = config[s][entry]
if ' ' in entry or '\t' in entry or "'" in entry or '"' in entry:
- raise EnvironmentException('Malformed variable name %s in cross file..' % varname)
+ raise EnvironmentException('Malformed variable name %s in cross file..' % entry)
try:
res = eval(value, {'true' : True, 'false' : False})
except Exception:
- raise EnvironmentException('Malformed value in cross file variable %s.' % varname)
+ raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
if self.ok_type(res):
self.config[s][entry] = res
elif isinstance(res, list):
for i in res:
if not self.ok_type(i):
- raise EnvironmentException('Malformed value in cross file variable %s.' % varname)
+ raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
self.config[s][entry] = res
else:
- raise EnvironmentException('Malformed value in cross file variable %s.' % varname)
+ raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
def has_host(self):
return 'host_machine' in self.config