tests: Use python3 compatible function attribute
This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f funcattrs -w -n Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
parent
330f2dd6bb
commit
8c851c2e36
3 changed files with 5 additions and 5 deletions
|
@ -488,12 +488,12 @@ def main():
|
||||||
set_term_echo(sys.stdin.fileno(), True)
|
set_term_echo(sys.stdin.fileno(), True)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
if t.func_code.co_argcount > 2:
|
if t.__code__.co_argcount > 2:
|
||||||
params = {}
|
params = {}
|
||||||
params['logdir'] = args.logdir
|
params['logdir'] = args.logdir
|
||||||
params['long'] = args.long
|
params['long'] = args.long
|
||||||
t(dev, apdev, params)
|
t(dev, apdev, params)
|
||||||
elif t.func_code.co_argcount > 1:
|
elif t.__code__.co_argcount > 1:
|
||||||
t(dev, apdev)
|
t(dev, apdev)
|
||||||
else:
|
else:
|
||||||
t(dev)
|
t(dev)
|
||||||
|
|
|
@ -68,9 +68,9 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test):
|
||||||
apdev.append(dut_host.dev)
|
apdev.append(dut_host.dev)
|
||||||
|
|
||||||
# run hwsim test/currently only 2 params tests
|
# run hwsim test/currently only 2 params tests
|
||||||
if hwsim_test.func_code.co_argcount == 1:
|
if hwsim_test.__code__.co_argcount == 1:
|
||||||
hwsim_test(dev)
|
hwsim_test(dev)
|
||||||
elif hwsim_test.func_code.co_argcount == 2:
|
elif hwsim_test.__code__.co_argcount == 2:
|
||||||
hwsim_test(dev, apdev)
|
hwsim_test(dev, apdev)
|
||||||
else:
|
else:
|
||||||
raise Exception("more than 2 arguments required")
|
raise Exception("more than 2 arguments required")
|
||||||
|
|
|
@ -200,7 +200,7 @@ def main():
|
||||||
t = None
|
t = None
|
||||||
for tt in hwsim_tests:
|
for tt in hwsim_tests:
|
||||||
name = tt.__name__.replace('test_', '', 1)
|
name = tt.__name__.replace('test_', '', 1)
|
||||||
if name == test and tt.func_code.co_argcount <= 2:
|
if name == test and tt.__code__.co_argcount <= 2:
|
||||||
t = tt
|
t = tt
|
||||||
break
|
break
|
||||||
if not t:
|
if not t:
|
||||||
|
|
Loading…
Reference in a new issue