src/reportlab/lib/rl_accel.py
branchpy33
changeset 4026 6c8ac18e0c9c
parent 4002 4bf4b598196e
child 4071 8a945e72d376
--- 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