Made osx-patch-ccid fail gracefully.

Throwing an exception causes the installer to fail, which we don't want.
This commit is contained in:
Dain Nilsson 2015-08-06 14:14:44 +02:00
parent 46d6da81dc
commit ed5e4c8fcc

View File

@ -52,19 +52,22 @@ def restart_pcscd():
def main():
print "Patching file:", FNAME
with open(FNAME, 'r') as f:
content = f.read()
try:
with open(FNAME, 'r') as f:
content = f.read()
for dev in DEVICES:
content = add_device(dev, content)
for dev in DEVICES:
content = add_device(dev, content)
print "Saving file:", FNAME
with open(FNAME, 'w') as f:
f.write(content)
print "Saving file:", FNAME
with open(FNAME, 'w') as f:
f.write(content)
restart_pcscd()
restart_pcscd()
print "Patching complete!"
print "Patching complete!"
except IOError as e:
print "Error patching file:", e
if __name__ == '__main__':