[Python-modules-commits] [ply] 02/08: Don't break already built packages with wrong _tabversion

Arnaud Fontaine arnau at moszumanska.debian.org
Fri Nov 18 06:50:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

arnau pushed a commit to branch master
in repository ply.

commit 30bd4b7bbcf989ec11b211e8bc7a6842889db196
Author: Jakub Wilk <jwilk at debian.org>
Date:   Thu Oct 8 10:15:00 2015 -0700

    Don't break already built packages with wrong _tabversion
    
    Forwarded: not-needed
    Patch-Name: relax-lex-tabversion-check.patch
---
 ply/lex.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ply/lex.py b/ply/lex.py
index 0f3e464..0b44a75 100644
--- a/ply/lex.py
+++ b/ply/lex.py
@@ -215,7 +215,14 @@ class Lexer:
             exec('import %s' % tabfile)
             lextab = sys.modules[tabfile]
 
-        if getattr(lextab, '_tabversion', '0.0') != __tabversion__:
+        # python-ply 3.3-1 is shipped by Debian since Squeeze, so
+        # to not break packages that were built with wrong
+        # _tabversion we need to explicitly fix it.
+        actual_tabversion = getattr(lextab, '_tabversion', '0.0')
+        if actual_tabversion in ('3.3', '3.4'):
+            actual_tabversion = '3.2'
+
+        if actual_tabversion != __tabversion__:
             raise ImportError('Inconsistent PLY version')
 
         self.lextokens      = lextab._lextokens

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/ply.git



More information about the Python-modules-commits mailing list