diff --git a/examples/python/gi/checkpoint.py b/examples/python/gi/checkpoint.py index 6e94b07cb..7a2655435 100755 --- a/examples/python/gi/checkpoint.py +++ b/examples/python/gi/checkpoint.py @@ -45,9 +45,11 @@ def show(c, ts=None): " timeout: %u seconds%s" % ( rt, - "" - if ts is None - else (" (circa %s sec left)" % ((cr + (rt * 1000) - ts) / 1000.0)), + ( + "" + if ts is None + else (" (circa %s sec left)" % ((cr + (rt * 1000) - ts) / 1000.0)) + ), ) ) print( diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index f274a460c..80e7a0012 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -2329,12 +2329,16 @@ class IP4Config(ExportedObj): a = { "dest": Util.random_ip(seed, net="192.168.0.0/16")[0], "prefix": Util.random_int(seed, 17, 32), - "next-hop": None - if (Util.random_int(seed) % 3 == 0) - else Util.random_ip(seed, net="192.168.0.0/16")[0], - "metric": -1 - if (Util.random_int(seed) % 3 == 0) - else Util.random_int(seed, 0, 0xFFFFFFFF), + "next-hop": ( + None + if (Util.random_int(seed) % 3 == 0) + else Util.random_ip(seed, net="192.168.0.0/16")[0] + ), + "metric": ( + -1 + if (Util.random_int(seed) % 3 == 0) + else Util.random_int(seed, 0, 0xFFFFFFFF) + ), } routes.append(a) @@ -2527,12 +2531,16 @@ class IP6Config(ExportedObj): a = { "dest": Util.random_ip(seed, net="2001:a::/64")[0], "prefix": Util.random_int(seed, 65, 128), - "next-hop": None - if (Util.random_int(seed) % 3 == 0) - else Util.random_ip(seed, net="2001:a::/64")[0], - "metric": -1 - if (Util.random_int(seed) % 3 == 0) - else Util.random_int(seed, 0, 0xFFFFFFFF), + "next-hop": ( + None + if (Util.random_int(seed) % 3 == 0) + else Util.random_ip(seed, net="2001:a::/64")[0] + ), + "metric": ( + -1 + if (Util.random_int(seed) % 3 == 0) + else Util.random_int(seed, 0, 0xFFFFFFFF) + ), } routes.append(a)