From cdea9b75955d3bf658c3dcda55b55e186b8d49b2 Mon Sep 17 00:00:00 2001 From: krelbel Date: Sun, 3 Jan 2021 17:00:49 -0800 Subject: [PATCH] Fix forcerealcopy bug for Python 3.8 users The code that checks whether the script is on the same drive as the ROM relies on Python 3.9-exclusive behavior that makes __file__ always return an absolute path. Because of this, Python 3.8 (or earlier) users would sometimes be forced to use real copies instead of hardlinks in situations that didn't require it. This change fixes this bug, bumps the version, and changes output to always print the version for easier debugging in the future. --- Main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Main.py b/Main.py index f38dd7a..49751fc 100644 --- a/Main.py +++ b/Main.py @@ -12,7 +12,7 @@ import datetime from tempfile import TemporaryDirectory -__version__ = '0.7.2' +__version__ = '0.7.3' # Creates a shuffled MSU-1 pack for ALttP Randomizer from one or more source # MSU-1 packs. @@ -478,8 +478,9 @@ def generate_shuffled_msu(args, rompath): logger.info('Done.') def main(args): + print("ALttPMSUShuffler version " + __version__) + if args.version: - print("ALttPMSUShuffler version " + __version__) return build_index(args) @@ -488,7 +489,7 @@ def main(args): args.forcerealcopy = args.realcopy try: # determine if the supplied rom is ON the same drive as the script. If not, realcopy is mandatory. - os.path.commonpath([os.path.abspath(rom), __file__]) + os.path.commonpath([os.path.abspath(rom), os.path.abspath(__file__)]) except: args.forcerealcopy = True