From 69f70836b940f0adf6569bd2eb1b69d4e672843b Mon Sep 17 00:00:00 2001 From: rocky Date: Thu, 17 Aug 2017 13:10:09 -0400 Subject: [PATCH] Remove stray debug; 3.7.tolerance --- test/unit/test-bytecode.py | 10 ++++++---- trepan/clifns.py | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/unit/test-bytecode.py b/test/unit/test-bytecode.py index b2e09c32..cd979040 100755 --- a/test/unit/test-bytecode.py +++ b/test/unit/test-bytecode.py @@ -3,7 +3,7 @@ import inspect, unittest from trepan.lib import bytecode as Mcode -from xdis import IS_PYPY +from xdis import IS_PYPY, PYTHON_VERSION class TestByteCode(unittest.TestCase): @@ -22,10 +22,12 @@ def sqr(x): def test_op_at_frame(self): frame = inspect.currentframe() - if IS_PYPY: - self.assertEqual('CALL_METHOD', Mcode.op_at_frame(frame)) + if IS_PYPY or PYTHON_VERSION >= 3.7: + call_opcode = 'CALL_METHOD' else: - self.assertEqual('CALL_FUNCTION', Mcode.op_at_frame(frame)) + call_opcode = 'CALL_FUNCTION' + + self.assertEqual(call_opcode, Mcode.op_at_frame(frame)) return def test_is_def_frame(self): diff --git a/trepan/clifns.py b/trepan/clifns.py index d377617e..b0161a7e 100755 --- a/trepan/clifns.py +++ b/trepan/clifns.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2008-2009, 2013 Rocky Bernstein +# Copyright (C) 2008-2009, 2013, 2017 Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -76,7 +76,6 @@ def whence_file(py_script, dirnames=None): for dirname in dirnames: py_script_try = osp.join(dirname, py_script) if osp.exists(py_script_try): - print("WOOT2", py_script_try) return osp.realpath(py_script_try) # Failure return py_script