Fix py-line-profiler incompatible decorators (#13911)

`@run_after` and `@when` are incompatible, issue #12736.
This commit is contained in:
Oliver Breitwieser 2019-11-27 15:30:53 +01:00 committed by Massimiliano Culpo
parent 51ee8aa639
commit d207dceb3a

View file

@ -24,8 +24,11 @@ class PyLineProfiler(PythonPackage):
# See https://github.com/rkern/line_profiler/issues/166 # See https://github.com/rkern/line_profiler/issues/166
@run_before('build') @run_before('build')
@when('^python@3.7:')
def fix_cython(self): def fix_cython(self):
# TODO: Replace the check with a `@when('^python@3.7:')` decorator once
# https://github.com/spack/spack/issues/12736 is resolved
if not self.spec.satisfies("^python@3.7:"):
return
cython = self.spec['py-cython'].command cython = self.spec['py-cython'].command
for root, _, files in os.walk('.'): for root, _, files in os.walk('.'):
for fn in files: for fn in files: