Fix invalid Python overrides

- mismatched method type
- mismatched parameter names
pull/9752/head
Tristan Partin 3 years ago committed by Eli Schwartz
parent 8d918e0147
commit 5d0538d235
  1. 4
      mesonbuild/compilers/c.py
  2. 4
      mesonbuild/compilers/cpp.py
  3. 8
      mesonbuild/compilers/mixins/clike.py

@ -53,9 +53,7 @@ else:
class CCompiler(CLikeCompiler, Compiler): class CCompiler(CLikeCompiler, Compiler):
def attribute_check_func(self, name: str) -> str:
@staticmethod
def attribute_check_func(name: str) -> str:
try: try:
return C_FUNC_ATTRIBUTES[name] return C_FUNC_ATTRIBUTES[name]
except KeyError: except KeyError:

@ -60,9 +60,7 @@ def non_msvc_eh_options(eh: str, args: T.List[str]) -> None:
'You may want to set eh to \'default\'.') 'You may want to set eh to \'default\'.')
class CPPCompiler(CLikeCompiler, Compiler): class CPPCompiler(CLikeCompiler, Compiler):
def attribute_check_func(self, name: str) -> str:
@classmethod
def attribute_check_func(cls, name: str) -> str:
try: try:
return CXX_FUNC_ATTRIBUTES.get(name, C_FUNC_ATTRIBUTES[name]) return CXX_FUNC_ATTRIBUTES.get(name, C_FUNC_ATTRIBUTES[name])
except KeyError: except KeyError:

@ -187,8 +187,8 @@ class CLikeCompiler(Compiler):
def get_no_optimization_args(self) -> T.List[str]: def get_no_optimization_args(self) -> T.List[str]:
return ['-O0'] return ['-O0']
def get_output_args(self, target: str) -> T.List[str]: def get_output_args(self, outputname: str) -> T.List[str]:
return ['-o', target] return ['-o', outputname]
def get_werror_args(self) -> T.List[str]: def get_werror_args(self) -> T.List[str]:
return ['-Werror'] return ['-Werror']
@ -270,8 +270,8 @@ class CLikeCompiler(Compiler):
def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]:
return ['-include', os.path.basename(header)] return ['-include', os.path.basename(header)]
def get_pch_name(self, header_name: str) -> str: def get_pch_name(self, name: str) -> str:
return os.path.basename(header_name) + '.' + self.get_pch_suffix() return os.path.basename(name) + '.' + self.get_pch_suffix()
def get_default_include_dirs(self) -> T.List[str]: def get_default_include_dirs(self) -> T.List[str]:
return [] return []

Loading…
Cancel
Save