Add compatibility with python 3 - relative imports, fix xrange, fix tests
This commit is contained in:
12
zk/base.py
12
zk/base.py
@@ -5,11 +5,11 @@ from socket import AF_INET, SOCK_DGRAM, SOCK_STREAM, socket, timeout
|
||||
from struct import pack, unpack
|
||||
import codecs
|
||||
|
||||
from zk import const
|
||||
from zk.attendance import Attendance
|
||||
from zk.exception import ZKErrorConnection, ZKErrorResponse, ZKNetworkError
|
||||
from zk.user import User
|
||||
from zk.finger import Finger
|
||||
from . import const
|
||||
from .attendance import Attendance
|
||||
from .exception import ZKErrorConnection, ZKErrorResponse, ZKNetworkError
|
||||
from .user import User
|
||||
from .finger import Finger
|
||||
|
||||
|
||||
def safe_cast(val, to_type, default=None):
|
||||
@@ -302,7 +302,7 @@ class ZK(object):
|
||||
|
||||
def __reverse_hex(self, hex):
|
||||
data = ''
|
||||
for i in reversed(xrange(len(hex) / 2)):
|
||||
for i in reversed(range(len(hex) / 2)):
|
||||
data += hex[i * 2:(i * 2) + 2]
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user