From 103ae06a012a32653f72de284e4439b6d41a66fe Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 14 Jul 2012 16:29:32 -0400 Subject: [PATCH] Minor fix to bfroehle's Python 3 changes. --- pudb/lowlevel.py | 11 ++++++++--- try-the-debugger.sh | 8 +++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pudb/lowlevel.py b/pudb/lowlevel.py index af013bb..9623cfb 100644 --- a/pudb/lowlevel.py +++ b/pudb/lowlevel.py @@ -4,9 +4,14 @@ from pudb.py3compat import PY3 def generate_executable_lines_for_code(code): l = code.co_firstlineno yield l - for c in code.co_lnotab[1::2]: - l += ord(c) - yield l + if PY3: + for c in code.co_lnotab[1::2]: + l += c + yield l + else: + for c in code.co_lnotab[1::2]: + l += ord(c) + yield l diff --git a/try-the-debugger.sh b/try-the-debugger.sh index 2d04714..42af1bb 100755 --- a/try-the-debugger.sh +++ b/try-the-debugger.sh @@ -1,3 +1,9 @@ #! /bin/sh -python -m pudb.run debug_me.py +if test "$1" = ""; then + PYINTERP="python" +else + PYINTERP="$1" +fi + +$PYINTERP -m pudb.run debug_me.py