From d6a0bafa99445e5679b5b3b2480f5fdd15a14c78 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 30 Aug 2013 12:23:34 -0700 Subject: [PATCH] Use the name for this attribute that exists on Python3 It also exists going back to 2.6. Change-Id: I8a1e285fa8091acf64bf5f9564d1a79882f9b3fb --- hacking/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hacking/core.py b/hacking/core.py index cb51d552..76931d2c 100755 --- a/hacking/core.py +++ b/hacking/core.py @@ -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: