From 756e75382679e86e38a66af32322d9ce56c18b7d Mon Sep 17 00:00:00 2001 From: bernatx Date: Fri, 30 Jul 2021 00:20:12 +0200 Subject: [PATCH] Revert "Refactor argument synch -> sync", because async is reserved word in Python This reverts commit 48bd1b45c0e45cf875c5267046f7911c47d611a3. --- PythonAPI/examples/generate_traffic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PythonAPI/examples/generate_traffic.py b/PythonAPI/examples/generate_traffic.py index 54fb41f2b..080c9a5d8 100755 --- a/PythonAPI/examples/generate_traffic.py +++ b/PythonAPI/examples/generate_traffic.py @@ -105,7 +105,7 @@ def main(): type=int, help='Port to communicate with TM (default: 8000)') argparser.add_argument( - '--async', + '--asynch', action='store_true', help='Activate asynchronous mode execution') argparser.add_argument( @@ -164,7 +164,7 @@ def main(): traffic_manager.set_random_device_seed(args.seed) settings = world.get_settings() - if not args.async: + if not args.asynch: traffic_manager.set_synchronous_mode(True) if not settings.synchronous_mode: synchronous_master = True @@ -309,7 +309,7 @@ def main(): all_actors = world.get_actors(all_id) # wait for a tick to ensure client receives the last transform of the walkers we have just created - if args.async or not synchronous_master: + if args.asynch or not synchronous_master: world.wait_for_tick() else: world.tick() @@ -331,14 +331,14 @@ def main(): traffic_manager.global_percentage_speed_difference(30.0) while True: - if not args.async and synchronous_master: + if not args.asynch and synchronous_master: world.tick() else: world.wait_for_tick() finally: - if not args.async and synchronous_master: + if not args.asynch and synchronous_master: settings = world.get_settings() settings.synchronous_mode = False settings.no_rendering_mode = False