From ae0d04f8b7f8c3cbe6a5a702809db00d236ba80d Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 2 May 2018 16:21:44 +0200 Subject: [PATCH] added some Python 3 compatibility --- .../src/vpicc/virtualsmartcard/SmartcardFilesystem.py | 4 ++-- virtualsmartcard/src/vpicc/virtualsmartcard/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py index 935dd72..6a65140 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py @@ -1353,8 +1353,8 @@ class MF(DF): T != TAG["FILECONTROLINFORMATION"]): raise ValueError for tag, _, value in tlv_data: - exec tag2cmd.get(tag, 'unknown(tag, value)') in locals(),\ - globals() + exec(tag2cmd.get(tag, 'unknown(tag, value)') in locals(), + globals()) if (args["filedescriptor"] & FDB["DF"]) == FDB["DF"]: # FIXME: data for DF diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/utils.py b/virtualsmartcard/src/vpicc/virtualsmartcard/utils.py index f589e63..dcb4514 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/utils.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/utils.py @@ -18,7 +18,7 @@ # import binascii import string -from ConstantDefinitions import MAX_SHORT_LE, MAX_EXTENDED_LE +from virtualsmartcard.ConstantDefinitions import MAX_SHORT_LE, MAX_EXTENDED_LE def stringtoint(str): @@ -44,7 +44,7 @@ def inttostring(i, length=None, len_extendable=False): return str -_myprintable = " " + string.letters + string.digits + string.punctuation +_myprintable = " " + string.ascii_letters + string.digits + string.punctuation def hexdump(data, indent=0, short=False, linelen=16, offset=0):