From e9706a4a09c2f4b190dbf098e0e202c91fb28482 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 23 Jan 2019 12:44:08 +0000 Subject: [PATCH] issue #477: _update_linecache() must append newlines. --- mitogen/core.py | 2 +- tests/importer_test.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mitogen/core.py b/mitogen/core.py index a7ff05b2..974b5209 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -1117,7 +1117,7 @@ class Importer(object): linecache.cache[path] = ( len(data), 0.0, - data.splitlines(), + [line+'\n' for line in data.splitlines()], path, ) diff --git a/tests/importer_test.py b/tests/importer_test.py index 5c970438..940c793a 100644 --- a/tests/importer_test.py +++ b/tests/importer_test.py @@ -212,5 +212,10 @@ class ImporterBlacklistTest(testlib.TestCase): self.assertTrue(mitogen.core.is_blacklisted_import(importer, 'builtins')) +class Python24LineCacheTest(testlib.TestCase): + # TODO: mitogen.core.Importer._update_linecache() + pass + + if __name__ == '__main__': unittest2.main()