From 4921daccf3ba3af2d06700094bb86f4bc9c8cc5b Mon Sep 17 00:00:00 2001 From: compiling <8335770+compiling@users.noreply.github.com> Date: Thu, 2 Jan 2020 12:38:26 +1100 Subject: [PATCH] Add Python 3.8 compatibility - replace deprecated function time.clock with time.perf_counter --- AdjusterMain.py | 4 ++-- Main.py | 4 ++-- Plando.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AdjusterMain.py b/AdjusterMain.py index 63466142..4646127c 100644 --- a/AdjusterMain.py +++ b/AdjusterMain.py @@ -7,7 +7,7 @@ from Rom import LocalRom, Sprite, apply_rom_settings def adjust(args): - start = time.clock() + start = time.perf_counter() logger = logging.getLogger('') logger.info('Patching ROM.') @@ -31,6 +31,6 @@ def adjust(args): rom.write_to_file(output_path('%s.sfc' % outfilebase)) logger.info('Done. Enjoy.') - logger.debug('Total Time: %s', time.clock() - start) + logger.debug('Total Time: %s', time.perf_counter() - start) return args diff --git a/Main.py b/Main.py index 39087ae5..2a621f18 100644 --- a/Main.py +++ b/Main.py @@ -21,7 +21,7 @@ from Utils import output_path __version__ = '0.6.3-pre' def main(args, seed=None): - start = time.clock() + start = time.perf_counter() # initialize the world world = World(args.multi, args.shuffle, args.logic, args.mode, args.swords, args.difficulty, args.item_functionality, args.timer, args.progressive, args.goal, args.algorithm, not args.nodungeonitems, args.accessibility, args.shuffleganon, args.quickswap, args.fastmenu, args.disablemusic, args.keysanity, args.retro, args.custom, args.customitemarray, args.shufflebosses, args.hints) @@ -172,7 +172,7 @@ def main(args, seed=None): world.spoiler.to_file(output_path('%s_Spoiler.txt' % outfilebase)) logger.info('Done. Enjoy.') - logger.debug('Total Time: %s', time.clock() - start) + logger.debug('Total Time: %s', time.perf_counter() - start) return world diff --git a/Plando.py b/Plando.py index 290e212b..1f2992bf 100755 --- a/Plando.py +++ b/Plando.py @@ -20,7 +20,7 @@ from Main import create_playthrough __version__ = '0.2-dev' def main(args): - start_time = time.clock() + start_time = time.perf_counter() # initialize the world world = World(1, 'vanilla', 'noglitches', 'standard', 'normal', 'none', 'on', 'ganon', 'freshness', False, False, False, args.quickswap, args.fastmenu, args.disablemusic, False, False, False, None, 'none', False) @@ -89,7 +89,7 @@ def main(args): world.spoiler.to_file('%s_Spoiler.txt' % outfilebase) logger.info('Done. Enjoy.') - logger.debug('Total Time: %s', time.clock() - start_time) + logger.debug('Total Time: %s', time.perf_counter() - start_time) return world