Permalink
Browse files

Substitute partial() if unavailable.

  • Loading branch information...
inducer committed Aug 11, 2012
1 parent 488689e commit 62bcf9fbafe4845ecd5795df22954472b7cb10f8
Showing with 12 additions and 1 deletion.
  1. +12 −1 pudb/debugger.py
View
@@ -16,6 +16,18 @@
else:
_next = "next"
+try:
+ from functools import partial
+except ImportError:
+ def partial(func, *args, **keywords):
+ def newfunc(*fargs, **fkeywords):
+ newkeywords = keywords.copy()
+ newkeywords.update(fkeywords)
+ return func(*(args + fargs), **newkeywords)
+ newfunc.func = func
+ newfunc.args = args
+ newfunc.keywords = keywords
+ return newfunc
HELP_TEXT = """\
Welcome to PuDB, the Python Urwid debugger.
@@ -398,7 +410,6 @@ def __init__(self, dbg):
# }}}
- from functools import partial
def change_rhs_box(name, index, direction, w, size, key):
from pudb.settings import save_config

0 comments on commit 62bcf9f

Please sign in to comment.