diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2018-09-17 15:17:29 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-17 15:17:29 +0300 | 
| commit | da8d72c953369b872a12c13f136ada77a786714a (patch) | |
| tree | bcfb6546be24ecf3efaee838934001fd931fa065 /Lib | |
| parent | 5e99b56d6b249995a4fa2bc09c0bb03841f49572 (diff) | |
| download | cpython-git-da8d72c953369b872a12c13f136ada77a786714a.tar.gz | |
bpo-12458: Fix line numbers for multiline expressions. (GH-8774)
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/test/test_dis.py | 8 | ||||
| -rw-r--r-- | Lib/test/test_doctest.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_faulthandler.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_traceback.py | 4 | ||||
| -rw-r--r-- | Lib/test/test_tracemalloc.py | 2 | 
5 files changed, 11 insertions, 7 deletions
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index c86f61f236..8d1912b6ee 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -124,7 +124,8 @@ dis_bug708901 = """\                2 LOAD_CONST               1 (1)  %3d           4 LOAD_CONST               2 (10) -              6 CALL_FUNCTION            2 + +%3d           6 CALL_FUNCTION            2                8 GET_ITER          >>   10 FOR_ITER                 4 (to 16)               12 STORE_FAST               0 (res) @@ -134,6 +135,7 @@ dis_bug708901 = """\               18 RETURN_VALUE  """ % (bug708901.__code__.co_firstlineno + 1,         bug708901.__code__.co_firstlineno + 2, +       bug708901.__code__.co_firstlineno + 1,         bug708901.__code__.co_firstlineno + 3) @@ -154,7 +156,8 @@ dis_bug1333982 = """\               16 CALL_FUNCTION            1  %3d          18 LOAD_CONST               4 (1) -             20 BINARY_ADD + +%3d          20 BINARY_ADD               22 CALL_FUNCTION            1               24 RAISE_VARARGS            1 @@ -164,6 +167,7 @@ dis_bug1333982 = """\         __file__,         bug1333982.__code__.co_firstlineno + 1,         bug1333982.__code__.co_firstlineno + 2, +       bug1333982.__code__.co_firstlineno + 1,         bug1333982.__code__.co_firstlineno + 3)  _BIG_LINENO_FORMAT = """\ diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 797bdb8471..efdce3c90c 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -2719,7 +2719,7 @@ Check doctest with a non-ascii filename:      Exception raised:          Traceback (most recent call last):            File ... -            compileflags, 1), test.globs) +            exec(compile(example.source, filename, "single",            File "<doctest foo-bär@baz[0]>", line 1, in <module>              raise Exception('clé')          Exception: clé diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index d6dc4ba55d..59289d026e 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -400,7 +400,7 @@ class FaultHandlerTests(unittest.TestCase):          if filename:              lineno = 9          elif fd is not None: -            lineno = 12 +            lineno = 11          else:              lineno = 14          expected = [ diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 3af85b8172..a8240b41c0 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -995,11 +995,11 @@ class TestStack(unittest.TestCase):          s = some_inner(3, 4)          self.assertEqual(              ['  File "%s", line %d, in some_inner\n' -             '    traceback.walk_stack(None), capture_locals=True, limit=1)\n' +             '    return traceback.StackSummary.extract(\n'               '    a = 1\n'               '    b = 2\n'               '    k = 3\n' -             '    v = 4\n' % (__file__, some_inner.__code__.co_firstlineno + 4) +             '    v = 4\n' % (__file__, some_inner.__code__.co_firstlineno + 3)              ], s.format())  class TestTracebackException(unittest.TestCase): diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index 491cd057ef..76a6159c7a 100644 --- a/Lib/test/test_tracemalloc.py +++ b/Lib/test/test_tracemalloc.py @@ -936,7 +936,7 @@ class TestCAPI(unittest.TestCase):              return None      def track(self, release_gil=False, nframe=1): -        frames = get_frames(nframe, 2) +        frames = get_frames(nframe, 1)          _testcapi.tracemalloc_track(self.domain, self.ptr, self.size,                                      release_gil)          return frames  | 
