rl_accel.py: fix global setting & calcChecksum py33
authorrobin
Fri, 07 Feb 2014 16:51:11 +0000
branchpy33
changeset 4026 6c8ac18e0c9c
parent 4025 b2eb4dd254cf
child 4027 3fd07cb65f90
rl_accel.py: fix global setting & calcChecksum
src/reportlab/lib/rl_accel.py
--- a/src/reportlab/lib/rl_accel.py	Fri Feb 07 13:51:31 2014 +0000
+++ b/src/reportlab/lib/rl_accel.py	Fri Feb 07 16:51:11 2014 +0000
@@ -131,7 +131,7 @@
     def calcChecksum(data):
         """Calculates TTF-style checksums"""
         data = rawBytes(data)
-        if len(data)&3: data = data + (4-(len(data)&3))*"\0"
+        if len(data)&3: data = data + (4-(len(data)&3))*b"\0"
         return sum(unpack(">%dl" % (len(data)>>2), data)) & 0xFFFFFFFF
     _py_funcs['calcChecksum'] = calcChecksum
 
@@ -327,7 +327,7 @@
 
 G=globals()
 for fn in __all__:
-    f = _c_funcs[fn] or _py_funcs[fn]
+    f = _c_funcs[fn] if fn in _c_funcs else _py_funcs[fn]
     if not f:
         raise RuntimeError('function %s is not properly defined' % fn)
     G[fn] = f