Use the name for this attribute that exists on Python3

It also exists going back to 2.6.

Change-Id: I8a1e285fa8091acf64bf5f9564d1a79882f9b3fb
This commit is contained in:
Alex Gaynor 2013-08-30 12:23:34 -07:00
parent e5c7d7b053
commit d6a0bafa99

View File

@ -72,10 +72,10 @@ def allownoqa(f):
HackingDecoratorError: if physical_line argument missing from
decorated function.
"""
if 'physical_line' not in f.func_code.co_varnames:
if 'physical_line' not in f.__code__.co_varnames:
raise HackingDecoratorError("Missing physical_line argument "
"for decorated function")
index = f.func_code.co_varnames.index('physical_line')
index = f.__code__.co_varnames.index('physical_line')
if pep8.noqa(args[index]):
return
else: