Prevent Print Error from Halt

If a unicode error happens in a debug print, program halted.
This commit is contained in:
tritoch 2017-06-22 12:19:20 -05:00 committed by GitHub
parent 5f56b74952
commit 55fe07b63b

View File

@ -598,7 +598,11 @@ def smash_mtgs_scryfall(mtgs, scryfall):
for key in scryfallcard:
if key in mtgscard:
if not mtgscard[key] == scryfallcard[key]:
print "%s's key %s\nMTGS : %s\nScryfall: %s" % (mtgscard['name'], key, mtgscard[key], scryfallcard[key])
try:
print "%s's key %s\nMTGS : %s\nScryfall: %s" % (mtgscard['name'], key, mtgscard[key], scryfallcard[key])
except:
print "Error printing Scryfall vs MTGS debug info for " + mtgscard['name']
pass
cardFound = True
if not cardFound:
print "MTGS has card %s and Scryfall does not." % mtgscard['name']