From 15b322c70a5661436ebbc8774d8e5fcffaae4c7a Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Fri, 28 Sep 2018 15:11:22 +0200 Subject: calling unicode() only once for args.* for conversion as we only use that --- refresh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/refresh b/refresh index 7f372ef..b107112 100755 --- a/refresh +++ b/refresh @@ -119,16 +119,17 @@ def main(args): year = [datetime.now().year] for i in locode: for j in year: + i = unicode(i); j = unicode(j) sys.stdout.write("Fetching holiday data from holidata.net... (%s, %s)" % (i, j)) sys.stdout.flush() - lines = hfetch(unicode(i), unicode(j)) + lines = hfetch(i, j) print(" done.") if lines == "": print("No lines returned from holidata.net for %s!", locode) exit(3) sys.stdout.write("Parsing data") sys.stdout.flush() - hparse(lines, unicode(i), unicode(j)) + hparse(lines, i, j) print(" done.") if __name__ == "__main__": -- cgit v1.2.3