diff MoinMoin/formatter/__init__.py @ 1181:a7f8dceb4410

remove types module usage
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 14 Aug 2006 00:12:34 +0200
parents 97ce857bdebf
children bc84eae93f8c
line wrap: on
line diff
--- a/MoinMoin/formatter/__init__.py	Sun Aug 13 23:43:20 2006 +0200
+++ b/MoinMoin/formatter/__init__.py	Mon Aug 14 00:12:34 2006 +0200
@@ -7,12 +7,13 @@
     @copyright: 2000-2004 by Jürgen Hermann <jh@web.de>
     @license: GNU GPL, see COPYING for details.
 """
+import re
+
 from MoinMoin.util import pysupport
+from MoinMoin import wikiutil
 
 modules = pysupport.getPackageModules(__file__)
 
-from MoinMoin import wikiutil
-import re, types
 
 class FormatterBase:
     """ This defines the output interface used all over the rest of the code.
@@ -37,7 +38,7 @@
         self._base_depth = 0
 
     def set_highlight_re(self, hi_re=None):
-        if type(hi_re) in [types.StringType, types.UnicodeType]:
+        if isinstance(hi_re, (str, unicode)):
             try:
                 self._highlight_re = re.compile(hi_re, re.U + re.IGNORECASE)
             except re.error: