diff options
author | Frazer Clews <frazerleslieclews@gmail.com> | 2020-08-24 15:51:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-25 18:14:46 +0100 |
commit | b0c807be5c2170c9481c1a04d4c11972135d7dc5 (patch) | |
tree | 9f5f673f8d88baa82120d0dbf7284d148fb04219 /lib/ply | |
parent | 4bb71b627767297269e762b414443e15e28bfac4 (diff) | |
download | bitbake-b0c807be5c2170c9481c1a04d4c11972135d7dc5.tar.gz |
lib: fix most undefined code picked up by pylint
Correctly import, and inherit functions, and variables.
Also fix some typos and remove some Python 2 code that isn't recognised.
Signed-off-by: Frazer Clews <frazerleslieclews@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/ply')
-rw-r--r-- | lib/ply/lex.py | 6 | ||||
-rw-r--r-- | lib/ply/yacc.py | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/ply/lex.py b/lib/ply/lex.py index 267ec100f..182f2e837 100644 --- a/lib/ply/lex.py +++ b/lib/ply/lex.py @@ -705,11 +705,7 @@ class LexerReflect(object): # Sort the functions by line number for f in self.funcsym.values(): - if sys.version_info[0] < 3: - f.sort(lambda x,y: cmp(func_code(x[1]).co_firstlineno,func_code(y[1]).co_firstlineno)) - else: - # Python 3.0 - f.sort(key=lambda x: func_code(x[1]).co_firstlineno) + f.sort(key=lambda x: func_code(x[1]).co_firstlineno) # Sort the strings by regular expression length for s in self.strsym.values(): diff --git a/lib/ply/yacc.py b/lib/ply/yacc.py index 561784f2f..46e7dc96f 100644 --- a/lib/ply/yacc.py +++ b/lib/ply/yacc.py @@ -1205,7 +1205,7 @@ class Production(object): # Precompute the list of productions immediately following. Hack. Remove later try: - p.lr_after = Prodnames[p.prod[n+1]] + p.lr_after = self.Prodnames[p.prod[n+1]] except (IndexError,KeyError): p.lr_after = [] try: |