fix py3.6 compatibility (fixes #5)

This commit is contained in:
Dirkjan Mollema
2020-05-20 19:00:48 +02:00
parent b196c48012
commit 1bb99afbc2
+5 -1
View File
@@ -413,7 +413,11 @@ def main(args=None):
headers['Authorization'] = '%s %s' % (token['tokenType'], token['accessToken'])
seconds = time.perf_counter()
asyncio.run(run(args, dburl))
try:
asyncio.run(run(args, dburl))
except AttributeError:
loop = asyncio.get_event_loop()
loop.run_until_complete(run(args, dburl))
elapsed = time.perf_counter() - seconds
print("ROADrecon gather executed in {0:0.2f} seconds and issued {1} HTTP requests.".format(elapsed, urlcounter))