diff --git a/samples/getinfo.py b/samples/getinfo.py
index <HASH>..<HASH> 100755
--- a/samples/getinfo.py
+++ b/samples/getinfo.py
@@ -49,7 +49,7 @@ for o, a in opts:
         pin_available = True
         open_session = True
     if o in ("-s", "--slot"):
-        slot = a
+        slot = int(a)
     if o in ("-d", "--lib"):
         lib = a
     if o in ("-o", "--opensession"):
convert the slot number from text to integer