Skip to content

Commit 49d9b50

Browse files
committed
Revise to use xdis 6.0.3
Sync somewhat with trepan3k cl.py -> __main__.py
1 parent af62abb commit 49d9b50

9 files changed

Lines changed: 31 additions & 299 deletions

File tree

__pkginfo__.py

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

2424
# Things that change more often go here.
2525
copyright = """
26-
Copyright (C) 2008-2010, 2013-2018, 2020 Rocky Bernstein <rocky@gnu.org>.
26+
Copyright (C) 2008-2010, 2013-2018, 2020-2021 Rocky Bernstein <rocky@gnu.org>.
2727
"""
2828

2929
classifiers = [
@@ -39,6 +39,7 @@
3939
"Programming Language :: Python :: 2.5",
4040
"Programming Language :: Python :: 2.6",
4141
"Programming Language :: Python :: 2.7",
42+
"Programming Language :: Python :: Implementation :: PyPy",
4243
]
4344

4445
# Python-version | package | last-version |
@@ -50,18 +51,26 @@
5051
# The rest in alphabetic order
5152
author = "Rocky Bernstein"
5253
author_email = "rocky@gnu.org"
54+
55+
entry_points = {
56+
"console_scripts": [
57+
"trepan2 = trepan.__main__:main",
58+
"trepan2c = trepan.client:main",
59+
]
60+
}
61+
5362
ftp_url = None
5463
install_requires = [
5564
"columnize >= 0.3.10",
5665
"nose>=1.0.0, <= 1.3.7",
57-
"pyficache >= 2.2.1",
66+
"pyficache >= 2.3.0",
5867
"pygments == 2.2.0", # Later releases don't support Python 2.7
5968
"spark_parser >= 1.8.9, <1.9.0",
60-
"uncompyle6 >= 3.7.4",
69+
"uncompyle6 >= 3.8.0",
6170
"term-background >= 1.0.1",
6271
"tracer >= 0.3.2",
6372
"unittest2",
64-
"xdis >= 5.0.4",
73+
"xdis >= 6.0.3,<6.1.0",
6574
]
6675
license = "GPL3"
6776
mailing_list = "python-debugger@googlegroups.com"
@@ -94,7 +103,7 @@ def get_srcdir():
94103
# trepan/version.py sets variable __version__.
95104
ns = {}
96105
exec(open(osp.join(get_srcdir(), "trepan", "version.py")).read(), ns)
97-
version = ns["__version__"]
106+
__version__ = ns["__version__"]
98107
web = "http://github.com/rocky/python2-trepan/"
99108

100109
# tracebacks in zip files are funky and not debuggable

admin-tools/setup-master.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
PYTHON_VERSION=2.7.15
2+
PYTHON_VERSION=2.7.18
33

44
# FIXME put some of the below in a common routine
55
function finish {

setup.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
author,
2929
author_email,
3030
classifiers,
31+
entry_points,
3132
install_requires,
3233
license,
3334
long_description,
3435
modname,
3536
packages,
3637
py_modules,
3738
short_desc,
38-
version,
39+
__version__,
3940
web,
4041
zip_safe,
4142
)
@@ -62,12 +63,7 @@
6263
)
6364
],
6465
description=short_desc,
65-
entry_points={
66-
"console_scripts": [
67-
"trepan2 = trepan.cli:main",
68-
"trepan2c = trepan.client:main",
69-
]
70-
},
66+
entry_points=entry_points,
7167
install_requires=install_requires,
7268
license=license,
7369
long_description=long_description,
@@ -76,6 +72,6 @@
7672
packages=packages,
7773
test_suite="nose.collector",
7874
url=web,
79-
version=version,
75+
version=__version__,
8076
zip_safe=zip_safe,
8177
)

test/integration/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def run_debugger(testname, python_file, dbgr_opts='', args='',
99
datadir = os.path.join(srcdir, '..', 'data')
1010
progdir = os.path.join(srcdir, '..', 'example')
1111
dbgrdir = os.path.join(srcdir, '..', '..', 'trepan')
12-
dbgr_short= "cli.py"
12+
dbgr_short= "__main__.py"
1313
dbgr_path = os.path.join(dbgrdir, dbgr_short)
1414

1515
if IS_PYPY:

test/unit/test-bytecode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import inspect, unittest
44

55
from trepan.lib import bytecode as Mcode
6-
from xdis import IS_PYPY, PYTHON_VERSION
6+
from xdis.version_info import IS_PYPY, PYTHON_VERSION_TRIPLE
77

88

99
class TestByteCode(unittest.TestCase):
@@ -22,7 +22,7 @@ def sqr(x):
2222

2323
def test_op_at_frame(self):
2424
frame = inspect.currentframe()
25-
if IS_PYPY or PYTHON_VERSION >= 3.7:
25+
if IS_PYPY or PYTHON_VERSION_TRIPLE >= (3, 7):
2626
call_opcode = 'CALL_METHOD'
2727
else:
2828
call_opcode = 'CALL_FUNCTION'

trepan/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2008-2009, 2013-2015, 2017 Rocky Bernstein <rocky@gnu.org>
2+
# Copyright (C) 2008-2009, 2013-2015, 2017, 2021 Rocky Bernstein <rocky@gnu.org>
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -13,10 +13,10 @@
1313
#
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
'''Some singleton debugger methods that can be called without first
16+
"""Some singleton debugger methods that can be called without first
1717
creating a debugger object -- these methods will create a debugger object,
1818
if necessary, first.
19-
'''
19+
"""
2020

2121
# The following routines could be done via something like the following
2222
# untested code:
@@ -185,7 +185,7 @@ def debug(dbg_opts=None, start_opts=None, post_mortem=True,
185185
>>> dbgr
186186
<trepan.debugger.Debugger instance at 0x2e25320>
187187
"""
188-
if Mdebugger.Debugger != type(Mdebugger.debugger_obj):
188+
if isinstance(Mdebugger.Debugger, Mdebugger.debugger_obj):
189189
Mdebugger.debugger_obj = Mdebugger.Debugger(dbg_opts)
190190
Mdebugger.debugger_obj.core.add_ignore(debug, stop)
191191
pass
@@ -224,7 +224,7 @@ def stop(opts=None):
224224
return None
225225

226226
# Demo it
227-
if __name__=='__main__':
227+
if __name__== "__main__":
228228
import tracer
229229

230230
def foo(n):

0 commit comments

Comments
 (0)