summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-genshi-isstring-helper.patch
diff options
context:
space:
mode:
authorAdriano Peluso <catonano@gmail.com>2017-04-05 15:29:56 +0200
committerArun Isaac <arunisaac@systemreboot.net>2017-05-27 18:41:12 +0530
commitb208f71b9b3540be9ae2b17b17b506a3526597b8 (patch)
treeca284e361d385ef3f93742fd3cac702a86227331 /gnu/packages/patches/python-genshi-isstring-helper.patch
parentad2ef260738982aa3493f1c54aa06aad8a827eea (diff)
gnu: Add python-genshi.
* gnu/packages/python.scm (python-genshi, python2-genshi): New variables. * gnu/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch: New file. * gnu/packages/patches/python-genshi-buildable-on-python-2.7.patch: New file. * gnu/packages/patches/python-genshi-disable-speedups-on-python-3.3.patch: New file. * gnu/packages/patches/python-genshi-fix-tests-on-python-3.5.patch: New file. * gnu/packages/patches/python-genshi-isstring-helper.patch: New file. * gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
Diffstat (limited to 'gnu/packages/patches/python-genshi-isstring-helper.patch')
-rw-r--r--gnu/packages/patches/python-genshi-isstring-helper.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-genshi-isstring-helper.patch b/gnu/packages/patches/python-genshi-isstring-helper.patch
new file mode 100644
index 0000000000..4f6c19bba9
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-isstring-helper.patch
@@ -0,0 +1,37 @@
+From cc5e07284f44cdd9beec178c69070a53f55d1323 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:43:20 +0000
+Subject: [PATCH 03/15] Add isstring helper.
+
+---
+ genshi/compat.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/genshi/compat.py b/genshi/compat.py
+index 9787325..6574e39 100644
+--- a/genshi/compat.py
++++ b/genshi/compat.py
+@@ -35,6 +35,15 @@ else:
+ 'Python 2 compatibility function. Not usable in Python 3.')
+
+
++# We need to test if an object is an instance of a string type in places
++
++if IS_PYTHON2:
++ def isstring(obj):
++ return isinstance(obj, basestring)
++else:
++ def isstring(obj):
++ return isinstance(obj, str)
++
+ # We need to differentiate between StringIO and BytesIO in places
+
+ if IS_PYTHON2:
+@@ -112,4 +121,3 @@ except NameError:
+ if not x:
+ return False
+ return True
+-
+--
+2.12.0
+