]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use python3 compatible function attribute
authorMasashi Honma <masashi.honma@gmail.com>
Thu, 24 Jan 2019 07:45:45 +0000 (16:45 +0900)
committerJouni Malinen <j@w1.fi>
Sat, 26 Jan 2019 11:00:03 +0000 (13:00 +0200)
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>
tests/hwsim/run-tests.py
tests/remote/hwsim_wrapper.py
tests/remote/run-tests.py

index 7e5edc7ff32b2f49f8602e824010273a1170d0e7..be0edcb7a7c105eade6e56ea4c98e2b08b2dfa90 100755 (executable)
@@ -488,12 +488,12 @@ def main():
                         set_term_echo(sys.stdin.fileno(), True)
                     sys.exit(1)
             try:
-                if t.func_code.co_argcount > 2:
+                if t.__code__.co_argcount > 2:
                     params = {}
                     params['logdir'] = args.logdir
                     params['long'] = args.long
                     t(dev, apdev, params)
-                elif t.func_code.co_argcount > 1:
+                elif t.__code__.co_argcount > 1:
                     t(dev, apdev)
                 else:
                     t(dev)
index d2598abb57ceeaa15414571776ae6782c750a000..c1bbb27d7c40adebae12d4c76a96e64f3c211544 100644 (file)
@@ -68,9 +68,9 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test):
             apdev.append(dut_host.dev)
 
         # 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)
-        elif hwsim_test.func_code.co_argcount == 2:
+        elif hwsim_test.__code__.co_argcount == 2:
             hwsim_test(dev, apdev)
         else:
             raise Exception("more than 2 arguments required")
index 28420501805a804d4df8222b27a375534c1beb1c..75497b4c9b5f4f7ee1d9a2dca9cba18af9d750e8 100755 (executable)
@@ -200,7 +200,7 @@ def main():
                 t = None
                 for tt in hwsim_tests:
                     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
                         break
                 if not t: