diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2010-09-07 08:46:31 -0700 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2010-09-07 08:46:31 -0700 |
commit | 9d03e681cad0a8e3193a94c8c899eb8c404ec96c (patch) | |
tree | e4c60702a75de6ec1e24bcb7f22907183c1f782f | |
parent | ad2734a2b453be98519445b93c78c29ca1a43b89 (diff) | |
download | markupsafe-9d03e681cad0a8e3193a94c8c899eb8c404ec96c.tar.gz |
Fixed partition and rparition. This fixes #1
-rw-r--r-- | markupsafe/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/markupsafe/__init__.py b/markupsafe/__init__.py index 01c77ce..1fe38f1 100644 --- a/markupsafe/__init__.py +++ b/markupsafe/__init__.py @@ -181,8 +181,12 @@ class Markup(unicode): # new in python 2.5 if hasattr(unicode, 'partition'): - partition = make_wrapper('partition'), - rpartition = make_wrapper('rpartition') + def partition(self, sep): + return tuple(map(self.__class__, + unicode.partition(self, escape(sep)))) + def rpartition(self, sep): + return tuple(map(self.__class__, + unicode.rpartition(self, escape(sep)))) # new in python 2.6 if hasattr(unicode, 'format'): |