utils.py: add ascii_letters, ascii definition py33
authorrobin
Mon, 18 Nov 2013 17:28:23 +0000
branchpy33
changeset 3788 fcfa76effd45
parent 3787 8f9be6d6f75c
child 3789 5bc95e1f3dd4
utils.py: add ascii_letters, ascii definition
src/reportlab/lib/utils.py
--- a/src/reportlab/lib/utils.py	Mon Nov 18 17:27:49 2013 +0000
+++ b/src/reportlab/lib/utils.py	Mon Nov 18 17:28:23 2013 +0000
@@ -53,6 +53,7 @@
 
     def isClass(v):
         return isinstance(v, type)
+    from string import ascii_letters
 else:
     def UniChr(v):
         return unichr(v)
@@ -69,6 +70,10 @@
     def isClass(v):
         import types
         return isinstance(v, types.ClassType)
+    from string import letters as ascii_letters
+    from future_builtins import ascii
+    import __builtin__
+    __builtin__.ascii = ascii
 
 
 def _findFiles(dirList,ext='.ttf'):
@@ -1141,7 +1146,10 @@
     else:
         A.append(msg)
     v.args = tuple(A)
-    raise t(v).with_traceback(b)
+    if isPy3:
+        raise t(v).with_traceback(b)
+    else:
+        raise (t,v,b)
     
 def escapeOnce(data):
     """Ensure XML output is escaped just once, irrespective of input