Skip to content

Commit

Permalink
Back out broken (and redundant) generated-code debugging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Oct 20, 2015
1 parent a57edf2 commit dd885f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pudb/__init__.py
@@ -1,4 +1,4 @@
NUM_VERSION = (2015, 4)
NUM_VERSION = (2015, 4, 1)
VERSION = ".".join(str(nv) for nv in NUM_VERSION)
__version__ = VERSION

Expand Down
23 changes: 10 additions & 13 deletions pudb/debugger.py
Expand Up @@ -11,7 +11,7 @@
CONFIG = load_config()
save_config(CONFIG)

from pudb.py3compat import PY3, raw_input, text_type
from pudb.py3compat import PY3, raw_input
if PY3:
_next = "__next__"
else:
Expand Down Expand Up @@ -599,21 +599,18 @@ def get_lines(self, debugger_ui):

lines = self.code.split("\n")

if isinstance(self.code, text_type):
decoded_lines = lines
else:
from pudb.lowlevel import detect_encoding
source_enc, _ = detect_encoding(getattr(iter(lines), _next))
from pudb.lowlevel import detect_encoding
source_enc, _ = detect_encoding(getattr(iter(lines), _next))

decoded_lines = []
for i, l in enumerate(lines):
if hasattr(l, "decode"):
l = l.decode(source_enc)
decoded_lines = []
for i, l in enumerate(lines):
if hasattr(l, "decode"):
l = l.decode(source_enc)

if i+1 < len(lines):
l += "\n"
if i+1 < len(lines):
l += "\n"

decoded_lines.append(l)
decoded_lines.append(l)

return format_source(debugger_ui, decoded_lines, set())

Expand Down

0 comments on commit dd885f3

Please sign in to comment.