Skip to content

Commit 0d8c8d1

Browse files
committed
Sync with trpean3k
1 parent 4aff1d2 commit 0d8c8d1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

trepan/processor/cmdproc.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from tracer import EVENT2SHORT
2525

26-
from trepan import vprocessor as Mprocessor
26+
from trepan.vprocessor import Processor
2727
from trepan.lib import bytecode as Mbytecode
2828
from trepan import exception as Mexcept
2929
from trepan.lib import display as Mdisplay
@@ -177,9 +177,8 @@ def print_location(proc_obj):
177177
remapped_file = None
178178
source_text = None
179179
while i_stack >= 0:
180-
frame_lineno = proc_obj.stack[i_stack]
180+
frame, lineno = proc_obj.stack[i_stack]
181181
i_stack -= 1
182-
frame, lineno = frame_lineno
183182

184183
# # Next check to see that local variable breadcrumb exists and
185184
# # has the magic dynamic value.
@@ -236,8 +235,9 @@ def print_location(proc_obj):
236235
# into the corresponding line of the tempfile
237236
co = proc_obj.curframe.f_code
238237
tempdir = proc_obj.settings("tempdir")
239-
temp_filename, name_for_code = deparse_and_cache(co, proc_obj.errmsg,
240-
tempdir=tempdir)
238+
temp_filename, name_for_code = deparse_and_cache(
239+
co, proc_obj.errmsg, tempdir=tempdir
240+
)
241241
lineno = 1
242242
# _, lineno = pyficache.unmap_file_line(temp_filename, lineno, True)
243243
if temp_filename:
@@ -257,14 +257,18 @@ def print_location(proc_obj):
257257
# FIXME: DRY code with version in cmdproc.py print_location
258258
prefix = osp.basename(temp_name).split(".")[0]
259259
fd = tempfile.NamedTemporaryFile(
260-
suffix=".py", prefix=prefix, delete=False,
260+
suffix=".py",
261+
prefix=prefix,
262+
delete=False,
261263
dir=proc_obj.settings("tempdir"),
262264
)
263265
with fd:
264266
fd.write("".join(lines))
265267
remapped_file = fd.name
266268
pyficache.remap_file(remapped_file, filename)
267269
fd.close()
270+
intf_obj.msg("remapped file %s to %s" % (filename, remapped_file))
271+
268272
pass
269273
line = linecache.getline(filename, lineno, proc_obj.curframe.f_globals)
270274
pass
@@ -305,10 +309,10 @@ def print_location(proc_obj):
305309
}
306310

307311

308-
class CommandProcessor(Mprocessor.Processor):
312+
class CommandProcessor(Processor):
309313
def __init__(self, core_obj, opts=None):
310314
get_option = lambda key: Mmisc.option_set(opts, key, DEFAULT_PROC_OPTS)
311-
Mprocessor.Processor.__init__(self, core_obj)
315+
Processor.__init__(self, core_obj)
312316

313317
self.continue_running = False # True if we should leave command loop
314318
self.event2short = dict(EVENT2SHORT)

0 commit comments

Comments
 (0)