Commits

Alessio Deiana committed 7ed74c6

Partial for python2.4

  • Participants
  • Parent commits 7b125fd

Comments (0)

Files changed (1)

 import traceback
 import sys
 from itertools import chain
-from functools import partial
+
+try:
+    from functools import partial
+except ImportError:
+    def partial(fn, *initialargs, **initialkwds):
+        def proxy(*finalargs, **finalkwds):
+            args = initialargs + finalargs
+            kwds = initialkwds.copy()
+            kwds.update(finalkwds)
+            return fn(*args, **kwds)
+        return proxy
+
 
 from webserver import run_simple
 from werkzeug._internal import _log