diff options
Diffstat (limited to 'bitbake/lib/ply/yacc.py')
-rw-r--r-- | bitbake/lib/ply/yacc.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/ply/yacc.py b/bitbake/lib/ply/yacc.py index 46e7dc96f6..381b50cf0b 100644 --- a/bitbake/lib/ply/yacc.py +++ b/bitbake/lib/ply/yacc.py | |||
@@ -2797,11 +2797,15 @@ class ParserReflect(object): | |||
2797 | # Compute a signature over the grammar | 2797 | # Compute a signature over the grammar |
2798 | def signature(self): | 2798 | def signature(self): |
2799 | try: | 2799 | try: |
2800 | from hashlib import md5 | 2800 | import hashlib |
2801 | except ImportError: | 2801 | except ImportError: |
2802 | from md5 import md5 | 2802 | raise RuntimeError("Unable to import hashlib") |
2803 | try: | ||
2804 | sig = hashlib.new('MD5', usedforsecurity=False) | ||
2805 | except TypeError: | ||
2806 | # Some configurations don't appear to support two arguments | ||
2807 | sig = hashlib.new('MD5') | ||
2803 | try: | 2808 | try: |
2804 | sig = md5() | ||
2805 | if self.start: | 2809 | if self.start: |
2806 | sig.update(self.start.encode('latin-1')) | 2810 | sig.update(self.start.encode('latin-1')) |
2807 | if self.prec: | 2811 | if self.prec: |