aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrey1931 <andrey1931@yandex-team.com>2023-11-21 11:11:15 +0300
committerandrey1931 <andrey1931@yandex-team.com>2023-11-21 12:23:40 +0300
commit53da909474dd9a00a009abd49fb2f8cdcdb20774 (patch)
tree9d3211379cd44ea29a1932350dd65c871d24b383
parentcb06c8c8c566e58f3778561aa46a0992b7adfa8b (diff)
downloadydb-53da909474dd9a00a009abd49fb2f8cdcdb20774.tar.gz
fix: ipdb не показывал исходный код PEERDIR'ов по команде list в py3
fix: ipdb не показывал следующую к исполнению команду в py2 и py3 ПР решает проблему https://st.yandex-team.ru/из п. 10: "не показывает текущее место в коде, на котором остановилось исполнение" Подсмотрел решение в pdb https://a.yandex-team.ru/arcadia/contrib/tools/python3/src/Lib/bdb.py?rev=rXXXXXX#L574
-rw-r--r--contrib/python/ipython/py2/IPython/core/debugger.py2
-rw-r--r--contrib/python/ipython/py3/IPython/core/debugger.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/contrib/python/ipython/py2/IPython/core/debugger.py b/contrib/python/ipython/py2/IPython/core/debugger.py
index f08cfb1a78..6a41b8b404 100644
--- a/contrib/python/ipython/py2/IPython/core/debugger.py
+++ b/contrib/python/ipython/py2/IPython/core/debugger.py
@@ -408,7 +408,7 @@ class Pdb(OldPdb):
ret.append(u'%s(%s)%s\n' % (link,lineno,call))
start = lineno - 1 - context//2
- lines = ulinecache.getlines(filename)
+ lines = ulinecache.getlines(filename, self.curframe.f_globals)
start = min(start, len(lines) - context)
start = max(start, 0)
lines = lines[start : start + context]
diff --git a/contrib/python/ipython/py3/IPython/core/debugger.py b/contrib/python/ipython/py3/IPython/core/debugger.py
index 8e968548f8..26bd45ff94 100644
--- a/contrib/python/ipython/py3/IPython/core/debugger.py
+++ b/contrib/python/ipython/py3/IPython/core/debugger.py
@@ -616,7 +616,7 @@ class Pdb(OldPdb):
ret.append("%s(%s)%s\n" % (link, lineno, call))
start = lineno - 1 - context//2
- lines = linecache.getlines(filename)
+ lines = linecache.getlines(filename, self.curframe.f_globals)
start = min(start, len(lines) - context)
start = max(start, 0)
lines = lines[start : start + context]
@@ -674,7 +674,7 @@ class Pdb(OldPdb):
filename = self._exec_filename
for lineno in range(first, last+1):
- line = linecache.getline(filename, lineno)
+ line = linecache.getline(filename, lineno, self.curframe.f_globals)
if not line:
break