Apply patch to silence a -3 warning about `reduce` removal. Closes #279.
author |
cmlenz |
date |
Mon, 08 Dec 2008 20:37:45 +0000 |
parents |
534ee7647c67 |
children |
be88c77839fc |
files |
genshi/core.py genshi/path.py |
diffstat |
2 files changed, 8 insertions(+), 0 deletions(-)
[+]
|
line diff
--- a/genshi/core.py
+++ b/genshi/core.py
@@ -13,6 +13,10 @@
"""Core classes for markup processing."""
+try:
+ from functools import reduce
+except ImportError:
+ pass # builtin in Python <= 2.5
from itertools import chain
import operator
--- a/genshi/path.py
+++ b/genshi/path.py
@@ -38,6 +38,10 @@
structures), it only implements a subset of the full XPath 1.0 language.
"""
+try:
+ from functools import reduce
+except ImportError:
+ pass # builtin in Python <= 2.5
from math import ceil, floor
import operator
import re