Commits

Ben Bangert committed df0c824 Merge
  • Participants
  • Parent commits 47498c4, 197c59b
  • Tags 0.3.3

Comments (0)

Files changed (2)

File webhelpers/pagination/__init__.py

 import re
 
 from routes import request_config
-from orm import get_wrapper
+from webhelpers.pagination.orm import get_wrapper
 
 find_page = re.compile('page=(\d+)', re.I)
 

File webhelpers/textile.py

 import sys
 import os
 import sgmllib
-import unicodedata
+try:
+    import unicodedata
+except ImportError:
+    unicodedata = None
 
 
 def _in_tag(text, tag):
             # Try the key.
             entity = macros[entity]
         except KeyError:
-            try:
-                # Try a unicode entity.
-                entity = unicodedata.lookup(entity)
-                entity = entity.encode('ascii', 'xmlcharrefreplace')
-            except:
+            if unicodedata:
+                try:
+                    # Try a unicode entity.
+                    entity = unicodedata.lookup(entity)
+                    entity = entity.encode('ascii', 'xmlcharrefreplace')
+                except:
+                    # Return the unmodified entity.
+                    entity = '{%s}' % entity
+            else:
                 # Return the unmodified entity.
                 entity = '{%s}' % entity