Skip to content

Commit

Permalink
Fix forcerealcopy bug for Python 3.8 users
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
krelbel committed Jan 4, 2021
1 parent 7bdd5dc commit cdea9b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit cdea9b7

Please sign in to comment.