aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-02-22 16:07:53 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2021-02-25 15:16:07 +0100
commitc8caec293333c7cfd93f29e9e7fa88f9cc78aa8b (patch)
treeaa224fa623c3fe69f468736d1ea743e5a983e222 /pySim-read.py
parentbdf3d3597b5d8e4260f80a00ada78e9ad612b00b (diff)
utils: catch exceptions during reader initalitation
Failed reader initializations happen frome time to time, mostly because of messed up commandline arguments. This results in ugly crashes very often. Lets control this a bit by catching the exception string and print it. Change-Id: I313017355da01bbef7c3d3f1899555aadb509319
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pySim-read.py b/pySim-read.py
index f901260..7906685 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -82,6 +82,8 @@ if __name__ == '__main__':
# Init card reader driver
sl = init_reader(opts)
+ if sl is None:
+ exit(1)
# Create command layer
scc = SimCardCommands(transport=sl)