summaryrefslogtreecommitdiff
path: root/textproc/py-markupsafe
diff options
context:
space:
mode:
authorjoerg <joerg>2013-05-23 15:08:26 +0000
committerjoerg <joerg>2013-05-23 15:08:26 +0000
commit847309641b3114ebba86c2ff38f006bf36766bd2 (patch)
treeada42c4394de7302bee5b70a098b4d0ea782ee54 /textproc/py-markupsafe
parent24d669ee88313ce1a8d50eaeec745017cdc33a2f (diff)
downloadpkgsrc-847309641b3114ebba86c2ff38f006bf36766bd2.tar.gz
Fix Python 3.x build.
Diffstat (limited to 'textproc/py-markupsafe')
-rw-r--r--textproc/py-markupsafe/distinfo4
-rw-r--r--textproc/py-markupsafe/patches/patch-markupsafe_____init____.py31
-rw-r--r--textproc/py-markupsafe/patches/patch-markupsafe_tests.py44
3 files changed, 78 insertions, 1 deletions
diff --git a/textproc/py-markupsafe/distinfo b/textproc/py-markupsafe/distinfo
index ac1dea0d7f2..ad8aa44a8a2 100644
--- a/textproc/py-markupsafe/distinfo
+++ b/textproc/py-markupsafe/distinfo
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.3 2013/05/22 11:52:43 kleink Exp $
+$NetBSD: distinfo,v 1.4 2013/05/23 15:08:26 joerg Exp $
SHA1 (MarkupSafe-0.18.tar.gz) = 9fe11891773f922a8b92e83c8f48edeb2f68631e
RMD160 (MarkupSafe-0.18.tar.gz) = 9773511d83b71a5208d9aa096996894697d8fc89
Size (MarkupSafe-0.18.tar.gz) = 11748 bytes
+SHA1 (patch-markupsafe_____init____.py) = 7f4a4dfc74ebcd49359aa685d055a09f1bf57cdf
+SHA1 (patch-markupsafe_tests.py) = 17f11a7763b5995ea273e7e302d5979734959b06
diff --git a/textproc/py-markupsafe/patches/patch-markupsafe_____init____.py b/textproc/py-markupsafe/patches/patch-markupsafe_____init____.py
new file mode 100644
index 00000000000..bec76124bef
--- /dev/null
+++ b/textproc/py-markupsafe/patches/patch-markupsafe_____init____.py
@@ -0,0 +1,31 @@
+$NetBSD: patch-markupsafe_____init____.py,v 1.1 2013/05/23 15:08:26 joerg Exp $
+
+--- markupsafe/__init__.py.orig 2013-05-23 10:39:34.000000000 +0000
++++ markupsafe/__init__.py
+@@ -65,7 +65,7 @@ class Markup(text_type):
+ """
+ __slots__ = ()
+
+- def __new__(cls, base=u'', encoding=None, errors='strict'):
++ def __new__(cls, base='', encoding=None, errors='strict'):
+ if hasattr(base, '__html__'):
+ base = base.__html__()
+ if encoding is None:
+@@ -139,7 +139,7 @@ class Markup(text_type):
+ return unichr(int(name[1:]))
+ except ValueError:
+ pass
+- return u''
++ return ''
+ return _entity_re.sub(handle_match, text_type(self))
+
+ def striptags(self):
+@@ -150,7 +150,7 @@ class Markup(text_type):
+ >>> Markup("Main &raquo; <em>About</em>").striptags()
+ u'Main \xbb About'
+ """
+- stripped = u' '.join(_striptags_re.sub('', self).split())
++ stripped = ' '.join(_striptags_re.sub('', self).split())
+ return Markup(stripped).unescape()
+
+ @classmethod
diff --git a/textproc/py-markupsafe/patches/patch-markupsafe_tests.py b/textproc/py-markupsafe/patches/patch-markupsafe_tests.py
new file mode 100644
index 00000000000..919ea39744e
--- /dev/null
+++ b/textproc/py-markupsafe/patches/patch-markupsafe_tests.py
@@ -0,0 +1,44 @@
+$NetBSD: patch-markupsafe_tests.py,v 1.1 2013/05/23 15:08:26 joerg Exp $
+
+--- markupsafe/tests.py.orig 2013-05-23 10:40:08.000000000 +0000
++++ markupsafe/tests.py
+@@ -48,16 +48,16 @@ class MarkupTestCase(unittest.TestCase):
+ self.assertEqual(Markup('<em>%s:%s</em>') % (
+ '<foo>',
+ '<bar>',
+- ), Markup(u'<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
++ ), Markup('<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
+
+ def test_dict_interpol(self):
+ self.assertEqual(Markup('<em>%(foo)s</em>') % {
+ 'foo': '<foo>',
+- }, Markup(u'<em>&lt;foo&gt;</em>'))
++ }, Markup('<em>&lt;foo&gt;</em>'))
+ self.assertEqual(Markup('<em>%(foo)s:%(bar)s</em>') % {
+ 'foo': '<foo>',
+ 'bar': '<bar>',
+- }, Markup(u'<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
++ }, Markup('<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
+
+ def test_escaping(self):
+ # escaping and unescaping
+@@ -73,7 +73,7 @@ class MarkupTestCase(unittest.TestCase):
+ def test_escape_silent(self):
+ assert escape_silent(None) == Markup()
+ assert escape(None) == Markup(None)
+- assert escape_silent('<foo>') == Markup(u'&lt;foo&gt;')
++ assert escape_silent('<foo>') == Markup('&lt;foo&gt;')
+
+ def test_splitting(self):
+ self.assertEqual(Markup('a b').split(), [
+@@ -101,8 +101,8 @@ class MarkupLeakTestCase(unittest.TestCa
+ for item in range(1000):
+ escape("foo")
+ escape("<foo>")
+- escape(u"foo")
+- escape(u"<foo>")
++ escape("foo")
++ escape("<foo>")
+ counts.add(len(gc.get_objects()))
+ assert len(counts) == 1, 'ouch, c extension seems to leak objects'
+