From f729cfc33f258781c5fd85a3d8773bf6149d12db Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Sat, 5 Jun 2021 22:02:54 -0700 Subject: SL-15742: Convert build scripts to Python 3 This changeset makes it possible to build the Second Life viewer using Python 3. It is designed to be used with an equivalent Autobuild branch so that a developer can compile without needing Python 2 on their machine. Breaking change: Python 2 support ending Rather than supporting two versions of Python, including one that was discontinued at the beginning of the year, this branch focuses on pouring future effort into Python 3 only. As a result, scripts do not need to be backwards compatible. This means that build environments, be they on personal computers and on build agents, need to have a compatible interpreter. Notes - SLVersionChecker will still use Python 2 on macOS - Fixed the message template url used by template_verifier.py --- scripts/metrics/viewer_asset_logs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/metrics/viewer_asset_logs.py') diff --git a/scripts/metrics/viewer_asset_logs.py b/scripts/metrics/viewer_asset_logs.py index e48286f696..0365936188 100644 --- a/scripts/metrics/viewer_asset_logs.py +++ b/scripts/metrics/viewer_asset_logs.py @@ -40,7 +40,7 @@ def get_metrics_record(infiles): context = iter(context) # get the root element - event, root = context.next() + event, root = next(context) try: for event, elem in context: if event == "end" and elem.tag == "llsd": @@ -48,7 +48,7 @@ def get_metrics_record(infiles): sd = llsd.parse_xml(xmlstr) yield sd except etree.XMLSyntaxError: - print "Fell off end of document" + print("Fell off end of document") f.close() @@ -56,7 +56,7 @@ def update_stats(stats,rec): for region in rec["regions"]: region_key = (region["grid_x"],region["grid_y"]) #print "region",region_key - for field, val in region.iteritems(): + for field, val in region.items(): if field in ["duration","grid_x","grid_y"]: continue if field == "fps": @@ -96,7 +96,7 @@ if __name__ == "__main__": for key in sorted(stats.keys()): val = stats[key] if val["count"] > 0: - print key,"count",val["count"],"mean_time",val["sum"]/val["count"],"mean_bytes",val["sum_bytes"]/val["count"],"net bytes/sec",val["sum_bytes"]/val["sum"],"enqueued",val["enqueued"],"dequeued",val["dequeued"] + print(key,"count",val["count"],"mean_time",val["sum"]/val["count"],"mean_bytes",val["sum_bytes"]/val["count"],"net bytes/sec",val["sum_bytes"]/val["sum"],"enqueued",val["enqueued"],"dequeued",val["dequeued"]) else: - print key,"count",val["count"],"enqueued",val["enqueued"],"dequeued",val["dequeued"] + print(key,"count",val["count"],"enqueued",val["enqueued"],"dequeued",val["dequeued"]) -- cgit v1.2.3