Make programming OPC optional
Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
diff --git a/pySim/cards.py b/pySim/cards.py
index a341b71..cb42d83 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -582,9 +582,9 @@
data, sw = self._scc.update_binary('00FF', p['ki'])
# set OPc in proprietary file
- content = "01" + p['opc']
- data, sw = self._scc.update_binary('00F7', content)
-
+ if 'opc' in p:
+ content = "01" + p['opc']
+ data, sw = self._scc.update_binary('00F7', content)
# write EF.IMSI
data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi']))