python3 support

py3
canghaiwuhen 9 months ago committed by Harald Welte
parent b456b1bb68
commit 62235aa9c9
  1. 2
      card/utils.py
  2. 2
      common.py
  3. 2
      simcard.py
  4. 2
      sysmo-isim-tool.sja2.py
  5. 2
      sysmo-usim-tool.sjs1.py
  6. 2
      sysmo_isim_sja2.py
  7. 2
      sysmo_usim.py
  8. 2
      sysmo_usim_sjs1.py
  9. 6
      utils.py

@ -351,7 +351,7 @@ def write_dict(dict, fd):
rec = dict[k]
if isinstance(rec, list) and \
len(rec) == [isinstance(i, int) for i in rec].count(True):
rec = ''.join(['[', ', '.join(map(hex, rec)), ']'])
rec = ''.join(['[', ', '.join(list(map(hex, rec))), ']'])
fd.write('%s: %s\n' % (k, rec))
def make_graph(FS, master_name='(0x3F, 0x00)\nMF'):

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@ -52,9 +52,9 @@ def ascii_to_list(string):
# Convert an ascii hex string to numeric list
def asciihex_to_list(string):
string = string.translate(None, ':')
string = string.translate(str.maketrans('','',':'))
try:
return map(ord, string.decode("hex"))
return list(map(ord,''.join(['%c' % b for b in bytearray.fromhex(string)])))
except:
print("Warning: Invalid hex string -- ignored!")
return []

Loading…
Cancel
Save