зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1515808 - Compensate for older python's buggy inspect.getblock. r=nalexander
Fixing this unveils an issue in TestRecursiveMake::test_linkage that was happening locally but not on automation, due to the Binary() template never being invoked on automation. Differential Revision: https://phabricator.services.mozilla.com/D15162 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7d73acbbfb
Коммит
73f192f7fd
|
@ -394,6 +394,11 @@ class TemplateFunction(object):
|
|||
code = func.func_code
|
||||
firstlineno = code.co_firstlineno
|
||||
lines = sandbox._current_source.splitlines(True)
|
||||
if lines:
|
||||
# Older versions of python 2.7 had a buggy inspect.getblock() that
|
||||
# would ignore the last line if it didn't terminate with a newline.
|
||||
if not lines[-1].endswith('\n'):
|
||||
lines[-1] += '\n'
|
||||
lines = inspect.getblock(lines[firstlineno - 1:])
|
||||
|
||||
# The code lines we get out of inspect.getsourcelines look like
|
||||
|
|
|
@ -209,6 +209,7 @@ CONFIGS = defaultdict(lambda: {
|
|||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'CC_TYPE': 'clang',
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'LIB_SUFFIX': 'a',
|
||||
'BIN_SUFFIX': '.exe',
|
||||
|
|
Загрузка…
Ссылка в новой задаче