summaryrefslogtreecommitdiff
path: root/debian/patches/lib2to3-no-pickled-grammar.diff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-12-01 17:44:24 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-12-01 17:44:24 +0300
commitc089c4500b0b78acf03ee5405ad250a84b0dfa66 (patch)
tree23870848d194569aff6e0e4e41bc7907960b1af1 /debian/patches/lib2to3-no-pickled-grammar.diff
parent377002e7300431b68f3548d9fd2c7f99cf883939 (diff)
downloadpython3.7-debian.tar.gz
Import python3.7 (3.7.5-2)debian/3.7.5-2debian
Diffstat (limited to 'debian/patches/lib2to3-no-pickled-grammar.diff')
-rw-r--r--debian/patches/lib2to3-no-pickled-grammar.diff16
1 files changed, 14 insertions, 2 deletions
diff --git a/debian/patches/lib2to3-no-pickled-grammar.diff b/debian/patches/lib2to3-no-pickled-grammar.diff
index 6364384..a7cc1ec 100644
--- a/debian/patches/lib2to3-no-pickled-grammar.diff
+++ b/debian/patches/lib2to3-no-pickled-grammar.diff
@@ -2,7 +2,7 @@ Index: b/Lib/lib2to3/pgen2/driver.py
===================================================================
--- a/Lib/lib2to3/pgen2/driver.py
+++ b/Lib/lib2to3/pgen2/driver.py
-@@ -122,7 +122,10 @@ def load_grammar(gt="Grammar.txt", gp=No
+@@ -120,7 +120,10 @@ def load_grammar(gt="Grammar.txt", gp=No
if force or not _newer(gp, gt):
logger.info("Generating grammar tables from %s", gt)
g = pgen.generate_grammar(gt)
@@ -18,7 +18,7 @@ Index: b/Lib/lib2to3/tests/test_parser.py
===================================================================
--- a/Lib/lib2to3/tests/test_parser.py
+++ b/Lib/lib2to3/tests/test_parser.py
-@@ -36,71 +36,6 @@
+@@ -38,83 +38,6 @@ class TestDriver(support.TestCase):
self.assertEqual(t.children[1].children[0].type, syms.print_stmt)
@@ -85,6 +85,18 @@ Index: b/Lib/lib2to3/tests/test_parser.py
- finally:
- shutil.rmtree(tmpdir)
-
+- def test_load_packaged_grammar(self):
+- modname = __name__ + '.load_test'
+- class MyLoader:
+- def get_data(self, where):
+- return pickle.dumps({'elephant': 19})
+- class MyModule:
+- __file__ = 'parsertestmodule'
+- __spec__ = importlib.util.spec_from_loader(modname, MyLoader())
+- sys.modules[modname] = MyModule()
+- self.addCleanup(operator.delitem, sys.modules, modname)
+- g = pgen2_driver.load_packaged_grammar(modname, 'Grammar.txt')
+- self.assertEqual(g.elephant, 19)
-
-
class GrammarTest(support.TestCase):