diff options
Diffstat (limited to 'Lib/lib2to3/pgen2/grammar.py')
-rw-r--r-- | Lib/lib2to3/pgen2/grammar.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py index c10dcfa..088c58b 100644 --- a/Lib/lib2to3/pgen2/grammar.py +++ b/Lib/lib2to3/pgen2/grammar.py @@ -108,6 +108,10 @@ class Grammar(object): d = pickle.load(f) self.__dict__.update(d) + def loads(self, pkl): + """Load the grammar tables from a pickle bytes object.""" + self.__dict__.update(pickle.loads(pkl)) + def copy(self): """ Copy the grammar. |