Python 2 is deprecated, remove backwards compatibility chunks
pySim has already been migrated to Python 3 in another change [1],
and the build verification has been migrated to Debian 10 with
Python 3.7. However, there is still some backwards compatibility
code left. Let's get rid of it.
[1] Ic78da9c03e99f59d142c93394051bbc2751f0205
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Tweaked-by: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Change-Id: I430d173535e0cd5bb895b9dfc9070cbc40cfc8ff
diff --git a/pySim/utils.py b/pySim/utils.py
index f7190d4..6dbd980 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -720,20 +720,13 @@
if not len(addr):
return None
- import sys
- # Handle python3 and python2 - unicode
- if sys.version_info[0] < 3:
- addr_str = unicode(addr)
- else:
- addr_str = addr
-
addr_list = addr.split('.')
# Check for IPv4/IPv6
try:
import ipaddress
# Throws ValueError if addr is not correct
- ipa = ipaddress.ip_address(addr_str)
+ ipa = ipaddress.ip_address(addr)
if ipa.version == 4:
return 0x01