summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/ply
diff options
context:
space:
mode:
authorFrazer Clews <frazerleslieclews@gmail.com>2020-08-24 15:51:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-25 18:14:53 +0100
commitabc6f864b9c6fa9a47a218a8250e79dcfa367d4d (patch)
treee4dfa762398e1b2a8ae019e0039417be3e85d99c /bitbake/lib/ply
parentac3593f6ed8f2ffb0bb62df47220b598cc1781f6 (diff)
downloadpoky-abc6f864b9c6fa9a47a218a8250e79dcfa367d4d.tar.gz
bitbake: 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. (Bitbake rev: b0c807be5c2170c9481c1a04d4c11972135d7dc5) Signed-off-by: Frazer Clews <frazerleslieclews@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/ply')
-rw-r--r--bitbake/lib/ply/lex.py6
-rw-r--r--bitbake/lib/ply/yacc.py2
2 files changed, 2 insertions, 6 deletions
diff --git a/bitbake/lib/ply/lex.py b/bitbake/lib/ply/lex.py
index 267ec100fc..182f2e8377 100644
--- a/bitbake/lib/ply/lex.py
+++ b/bitbake/lib/ply/lex.py
@@ -705,11 +705,7 @@ class LexerReflect(object):
705 705
706 # Sort the functions by line number 706 # Sort the functions by line number
707 for f in self.funcsym.values(): 707 for f in self.funcsym.values():
708 if sys.version_info[0] < 3: 708 f.sort(key=lambda x: func_code(x[1]).co_firstlineno)
709 f.sort(lambda x,y: cmp(func_code(x[1]).co_firstlineno,func_code(y[1]).co_firstlineno))
710 else:
711 # Python 3.0
712 f.sort(key=lambda x: func_code(x[1]).co_firstlineno)
713 709
714 # Sort the strings by regular expression length 710 # Sort the strings by regular expression length
715 for s in self.strsym.values(): 711 for s in self.strsym.values():
diff --git a/bitbake/lib/ply/yacc.py b/bitbake/lib/ply/yacc.py
index 561784f2f7..46e7dc96f6 100644
--- a/bitbake/lib/ply/yacc.py
+++ b/bitbake/lib/ply/yacc.py
@@ -1205,7 +1205,7 @@ class Production(object):
1205 1205
1206 # Precompute the list of productions immediately following. Hack. Remove later 1206 # Precompute the list of productions immediately following. Hack. Remove later
1207 try: 1207 try:
1208 p.lr_after = Prodnames[p.prod[n+1]] 1208 p.lr_after = self.Prodnames[p.prod[n+1]]
1209 except (IndexError,KeyError): 1209 except (IndexError,KeyError):
1210 p.lr_after = [] 1210 p.lr_after = []
1211 try: 1211 try: