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:53 +0100 |
commit | abc6f864b9c6fa9a47a218a8250e79dcfa367d4d (patch) | |
tree | e4dfa762398e1b2a8ae019e0039417be3e85d99c /bitbake | |
parent | ac3593f6ed8f2ffb0bb62df47220b598cc1781f6 (diff) | |
download | poky-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')
-rw-r--r-- | bitbake/lib/bb/__init__.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/daemonize.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/osc.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/ssh.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/msg.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/namedtuple_with_abc.py | 14 | ||||
-rw-r--r-- | bitbake/lib/bb/process.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/server/process.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/tests/data.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/ncurses.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/uievent.py | 6 | ||||
-rw-r--r-- | bitbake/lib/hashserv/tests.py | 1 | ||||
-rw-r--r-- | bitbake/lib/layerindexlib/__init__.py | 15 | ||||
-rw-r--r-- | bitbake/lib/layerindexlib/cooker.py | 7 | ||||
-rw-r--r-- | bitbake/lib/layerindexlib/restapi.py | 6 | ||||
-rw-r--r-- | bitbake/lib/layerindexlib/tests/restapi.py | 2 | ||||
-rw-r--r-- | bitbake/lib/ply/lex.py | 6 | ||||
-rw-r--r-- | bitbake/lib/ply/yacc.py | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/tests/functional/functional_helpers.py | 8 |
22 files changed, 51 insertions, 42 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index 2c94e10c80..888dd5ccc6 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
@@ -93,7 +93,7 @@ class BBLoggerAdapter(logging.LoggerAdapter, BBLoggerMixin): | |||
93 | 93 | ||
94 | def __repr__(self): | 94 | def __repr__(self): |
95 | logger = self.logger | 95 | logger = self.logger |
96 | level = getLevelName(logger.getEffectiveLevel()) | 96 | level = logger.getLevelName(logger.getEffectiveLevel()) |
97 | return '<%s %s (%s)>' % (self.__class__.__name__, logger.name, level) | 97 | return '<%s %s (%s)>' % (self.__class__.__name__, logger.name, level) |
98 | 98 | ||
99 | logging.LoggerAdapter = BBLoggerAdapter | 99 | logging.LoggerAdapter = BBLoggerAdapter |
diff --git a/bitbake/lib/bb/daemonize.py b/bitbake/lib/bb/daemonize.py index f01e6ec7cc..c187fcfc6c 100644 --- a/bitbake/lib/bb/daemonize.py +++ b/bitbake/lib/bb/daemonize.py | |||
@@ -14,6 +14,8 @@ import sys | |||
14 | import io | 14 | import io |
15 | import traceback | 15 | import traceback |
16 | 16 | ||
17 | import bb | ||
18 | |||
17 | def createDaemon(function, logfile): | 19 | def createDaemon(function, logfile): |
18 | """ | 20 | """ |
19 | Detach a process from the controlling terminal and run it in the | 21 | Detach a process from the controlling terminal and run it in the |
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 7f1b6dcb4f..c559102cf5 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -189,7 +189,7 @@ class IncludeHistory(object): | |||
189 | if self.current.parent: | 189 | if self.current.parent: |
190 | self.current = self.current.parent | 190 | self.current = self.current.parent |
191 | else: | 191 | else: |
192 | bb.warn("Include log: Tried to finish '%s' at top level." % filename) | 192 | bb.warn("Include log: Tried to finish '%s' at top level." % self.filename) |
193 | return False | 193 | return False |
194 | 194 | ||
195 | def emit(self, o, level = 0): | 195 | def emit(self, o, level = 0): |
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py index 8f091efd02..3a6cd29510 100644 --- a/bitbake/lib/bb/fetch2/osc.py +++ b/bitbake/lib/bb/fetch2/osc.py | |||
@@ -8,12 +8,15 @@ Based on the svn "Fetch" implementation. | |||
8 | """ | 8 | """ |
9 | 9 | ||
10 | import logging | 10 | import logging |
11 | import os | ||
11 | import bb | 12 | import bb |
12 | from bb.fetch2 import FetchMethod | 13 | from bb.fetch2 import FetchMethod |
13 | from bb.fetch2 import FetchError | 14 | from bb.fetch2 import FetchError |
14 | from bb.fetch2 import MissingParameterError | 15 | from bb.fetch2 import MissingParameterError |
15 | from bb.fetch2 import runfetchcmd | 16 | from bb.fetch2 import runfetchcmd |
16 | 17 | ||
18 | logger = logging.getLogger(__name__) | ||
19 | |||
17 | class Osc(FetchMethod): | 20 | class Osc(FetchMethod): |
18 | """Class to fetch a module or modules from Opensuse build server | 21 | """Class to fetch a module or modules from Opensuse build server |
19 | repositories.""" | 22 | repositories.""" |
diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py index 5e982ecf38..2c8557e1f8 100644 --- a/bitbake/lib/bb/fetch2/ssh.py +++ b/bitbake/lib/bb/fetch2/ssh.py | |||
@@ -31,8 +31,7 @@ IETF secsh internet draft: | |||
31 | # | 31 | # |
32 | 32 | ||
33 | import re, os | 33 | import re, os |
34 | from bb.fetch2 import FetchMethod | 34 | from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd |
35 | from bb.fetch2 import runfetchcmd | ||
36 | 35 | ||
37 | 36 | ||
38 | __pattern__ = re.compile(r''' | 37 | __pattern__ = re.compile(r''' |
@@ -65,7 +64,7 @@ class SSH(FetchMethod): | |||
65 | 64 | ||
66 | def urldata_init(self, urldata, d): | 65 | def urldata_init(self, urldata, d): |
67 | if 'protocol' in urldata.parm and urldata.parm['protocol'] == 'git': | 66 | if 'protocol' in urldata.parm and urldata.parm['protocol'] == 'git': |
68 | raise bb.fetch2.ParameterError( | 67 | raise ParameterError( |
69 | "Invalid protocol - if you wish to fetch from a git " + | 68 | "Invalid protocol - if you wish to fetch from a git " + |
70 | "repository using ssh, you need to use " + | 69 | "repository using ssh, you need to use " + |
71 | "git:// prefix with protocol=ssh", urldata.url) | 70 | "git:// prefix with protocol=ssh", urldata.url) |
@@ -105,7 +104,7 @@ class SSH(FetchMethod): | |||
105 | dldir | 104 | dldir |
106 | ) | 105 | ) |
107 | 106 | ||
108 | bb.fetch2.check_network_access(d, cmd, urldata.url) | 107 | check_network_access(d, cmd, urldata.url) |
109 | 108 | ||
110 | runfetchcmd(cmd, d) | 109 | runfetchcmd(cmd, d) |
111 | 110 | ||
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 1b1a23bb50..6f17b6acc7 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py | |||
@@ -14,6 +14,7 @@ import sys | |||
14 | import copy | 14 | import copy |
15 | import logging | 15 | import logging |
16 | import logging.config | 16 | import logging.config |
17 | import os | ||
17 | from itertools import groupby | 18 | from itertools import groupby |
18 | import bb | 19 | import bb |
19 | import bb.event | 20 | import bb.event |
diff --git a/bitbake/lib/bb/namedtuple_with_abc.py b/bitbake/lib/bb/namedtuple_with_abc.py index 646aed6ffd..e46dbf0849 100644 --- a/bitbake/lib/bb/namedtuple_with_abc.py +++ b/bitbake/lib/bb/namedtuple_with_abc.py | |||
@@ -61,17 +61,9 @@ class _NamedTupleABCMeta(ABCMeta): | |||
61 | return ABCMeta.__new__(mcls, name, bases, namespace) | 61 | return ABCMeta.__new__(mcls, name, bases, namespace) |
62 | 62 | ||
63 | 63 | ||
64 | exec( | 64 | class _NamedTupleABC(metaclass=_NamedTupleABCMeta): |
65 | # Python 2.x metaclass declaration syntax | 65 | '''The abstract base class + mix-in for named tuples.''' |
66 | """class _NamedTupleABC(object): | 66 | _fields = abstractproperty() |
67 | '''The abstract base class + mix-in for named tuples.''' | ||
68 | __metaclass__ = _NamedTupleABCMeta | ||
69 | _fields = abstractproperty()""" if version_info[0] < 3 else | ||
70 | # Python 3.x metaclass declaration syntax | ||
71 | """class _NamedTupleABC(metaclass=_NamedTupleABCMeta): | ||
72 | '''The abstract base class + mix-in for named tuples.''' | ||
73 | _fields = abstractproperty()""" | ||
74 | ) | ||
75 | 67 | ||
76 | 68 | ||
77 | _namedtuple.abc = _NamedTupleABC | 69 | _namedtuple.abc = _NamedTupleABC |
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py index f36c929d25..7c3995cce5 100644 --- a/bitbake/lib/bb/process.py +++ b/bitbake/lib/bb/process.py | |||
@@ -7,6 +7,7 @@ import signal | |||
7 | import subprocess | 7 | import subprocess |
8 | import errno | 8 | import errno |
9 | import select | 9 | import select |
10 | import bb | ||
10 | 11 | ||
11 | logger = logging.getLogger('BitBake.Process') | 12 | logger = logging.getLogger('BitBake.Process') |
12 | 13 | ||
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index 005ac34775..74cdd3f3ea 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -25,6 +25,7 @@ import subprocess | |||
25 | import errno | 25 | import errno |
26 | import re | 26 | import re |
27 | import datetime | 27 | import datetime |
28 | import pickle | ||
28 | import bb.server.xmlrpcserver | 29 | import bb.server.xmlrpcserver |
29 | from bb import daemonize | 30 | from bb import daemonize |
30 | from multiprocessing import queues | 31 | from multiprocessing import queues |
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py index 5f195047de..1d4a64b109 100644 --- a/bitbake/lib/bb/tests/data.py +++ b/bitbake/lib/bb/tests/data.py | |||
@@ -12,6 +12,7 @@ import bb | |||
12 | import bb.data | 12 | import bb.data |
13 | import bb.parse | 13 | import bb.parse |
14 | import logging | 14 | import logging |
15 | import os | ||
15 | 16 | ||
16 | class LogRecord(): | 17 | class LogRecord(): |
17 | def __enter__(self): | 18 | def __enter__(self): |
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index e19d9cff04..5755e5a346 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -732,7 +732,7 @@ class Tinfoil: | |||
732 | continue | 732 | continue |
733 | if helper.eventHandler(event): | 733 | if helper.eventHandler(event): |
734 | if isinstance(event, bb.build.TaskFailedSilent): | 734 | if isinstance(event, bb.build.TaskFailedSilent): |
735 | logger.warning("Logfile for failed setscene task is %s" % event.logfile) | 735 | self.logger.warning("Logfile for failed setscene task is %s" % event.logfile) |
736 | elif isinstance(event, bb.build.TaskFailed): | 736 | elif isinstance(event, bb.build.TaskFailed): |
737 | bb.ui.knotty.print_event_log(event, includelogs, loglines, termfilter) | 737 | bb.ui.knotty.print_event_log(event, includelogs, loglines, termfilter) |
738 | continue | 738 | continue |
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 87e873d644..a3507afb7c 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -144,7 +144,7 @@ class TerminalFilter(object): | |||
144 | pass | 144 | pass |
145 | if not cr: | 145 | if not cr: |
146 | try: | 146 | try: |
147 | cr = (env['LINES'], env['COLUMNS']) | 147 | cr = (os.environ['LINES'], os.environ['COLUMNS']) |
148 | except: | 148 | except: |
149 | cr = (25, 80) | 149 | cr = (25, 80) |
150 | return cr | 150 | return cr |
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index da4fbeabb6..cf1c876a51 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py | |||
@@ -48,6 +48,8 @@ import bb | |||
48 | import xmlrpc.client | 48 | import xmlrpc.client |
49 | from bb.ui import uihelper | 49 | from bb.ui import uihelper |
50 | 50 | ||
51 | logger = logging.getLogger(__name__) | ||
52 | |||
51 | parsespin = itertools.cycle( r'|/-\\' ) | 53 | parsespin = itertools.cycle( r'|/-\\' ) |
52 | 54 | ||
53 | X = 0 | 55 | X = 0 |
diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py index 13d0d4a04c..8607d0523b 100644 --- a/bitbake/lib/bb/ui/uievent.py +++ b/bitbake/lib/bb/ui/uievent.py | |||
@@ -11,9 +11,13 @@ server and queue them for the UI to process. This process must be used to avoid | |||
11 | client/server deadlocks. | 11 | client/server deadlocks. |
12 | """ | 12 | """ |
13 | 13 | ||
14 | import socket, threading, pickle, collections | 14 | import collections, logging, pickle, socket, threading |
15 | from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler | 15 | from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler |
16 | 16 | ||
17 | import bb | ||
18 | |||
19 | logger = logging.getLogger(__name__) | ||
20 | |||
17 | class BBUIEventQueue: | 21 | class BBUIEventQueue: |
18 | def __init__(self, BBServer, clientinfo=("localhost, 0")): | 22 | def __init__(self, BBServer, clientinfo=("localhost, 0")): |
19 | 23 | ||
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index 6e86295079..b34c436876 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -9,6 +9,7 @@ from . import create_server, create_client | |||
9 | import hashlib | 9 | import hashlib |
10 | import logging | 10 | import logging |
11 | import multiprocessing | 11 | import multiprocessing |
12 | import os | ||
12 | import sys | 13 | import sys |
13 | import tempfile | 14 | import tempfile |
14 | import threading | 15 | import threading |
diff --git a/bitbake/lib/layerindexlib/__init__.py b/bitbake/lib/layerindexlib/__init__.py index 77196b408f..45157b6681 100644 --- a/bitbake/lib/layerindexlib/__init__.py +++ b/bitbake/lib/layerindexlib/__init__.py | |||
@@ -7,6 +7,7 @@ import datetime | |||
7 | 7 | ||
8 | import logging | 8 | import logging |
9 | import imp | 9 | import imp |
10 | import os | ||
10 | 11 | ||
11 | from collections import OrderedDict | 12 | from collections import OrderedDict |
12 | from layerindexlib.plugin import LayerIndexPluginUrlError | 13 | from layerindexlib.plugin import LayerIndexPluginUrlError |
@@ -70,7 +71,7 @@ class LayerIndex(): | |||
70 | 71 | ||
71 | if self.__class__ != newIndex.__class__ or \ | 72 | if self.__class__ != newIndex.__class__ or \ |
72 | other.__class__ != newIndex.__class__: | 73 | other.__class__ != newIndex.__class__: |
73 | raise TypeException("Can not add different types.") | 74 | raise TypeError("Can not add different types.") |
74 | 75 | ||
75 | for indexEnt in self.indexes: | 76 | for indexEnt in self.indexes: |
76 | newIndex.indexes.append(indexEnt) | 77 | newIndex.indexes.append(indexEnt) |
@@ -266,8 +267,8 @@ will write out the individual elements split by layer and related components. | |||
266 | logger.debug(1, "Store not implemented in %s" % plugin.type) | 267 | logger.debug(1, "Store not implemented in %s" % plugin.type) |
267 | pass | 268 | pass |
268 | else: | 269 | else: |
269 | logger.debug(1, "No plugins support %s" % url) | 270 | logger.debug(1, "No plugins support %s" % indexURI) |
270 | raise LayerIndexException("No plugins support %s" % url) | 271 | raise LayerIndexException("No plugins support %s" % indexURI) |
271 | 272 | ||
272 | 273 | ||
273 | def is_empty(self): | 274 | def is_empty(self): |
@@ -657,7 +658,7 @@ class LayerIndexObj(): | |||
657 | if obj.id in self._index[indexname]: | 658 | if obj.id in self._index[indexname]: |
658 | if self._index[indexname][obj.id] == obj: | 659 | if self._index[indexname][obj.id] == obj: |
659 | continue | 660 | continue |
660 | raise LayerIndexError('Conflict adding object %s(%s) to index' % (indexname, obj.id)) | 661 | raise LayerIndexException('Conflict adding object %s(%s) to index' % (indexname, obj.id)) |
661 | self._index[indexname][obj.id] = obj | 662 | self._index[indexname][obj.id] = obj |
662 | 663 | ||
663 | def add_raw_element(self, indexname, objtype, rawobjs): | 664 | def add_raw_element(self, indexname, objtype, rawobjs): |
@@ -842,11 +843,11 @@ class LayerIndexObj(): | |||
842 | 843 | ||
843 | def _resolve_dependencies(layerbranches, ignores, dependencies, invalid): | 844 | def _resolve_dependencies(layerbranches, ignores, dependencies, invalid): |
844 | for layerbranch in layerbranches: | 845 | for layerbranch in layerbranches: |
845 | if ignores and layerBranch.layer.name in ignores: | 846 | if ignores and layerbranch.layer.name in ignores: |
846 | continue | 847 | continue |
847 | 848 | ||
848 | for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerBranch.id]: | 849 | for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerbranch.id]: |
849 | deplayerbranch = layerDependency.dependency_layerBranch | 850 | deplayerbranch = layerdependency.dependency_layerBranch |
850 | 851 | ||
851 | if ignores and deplayerbranch.layer.name in ignores: | 852 | if ignores and deplayerbranch.layer.name in ignores: |
852 | continue | 853 | continue |
diff --git a/bitbake/lib/layerindexlib/cooker.py b/bitbake/lib/layerindexlib/cooker.py index 65b23d087f..21ec438a22 100644 --- a/bitbake/lib/layerindexlib/cooker.py +++ b/bitbake/lib/layerindexlib/cooker.py | |||
@@ -4,6 +4,7 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | import logging | 6 | import logging |
7 | import os | ||
7 | 8 | ||
8 | from collections import defaultdict | 9 | from collections import defaultdict |
9 | 10 | ||
@@ -73,7 +74,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): | |||
73 | d = self.layerindex.data | 74 | d = self.layerindex.data |
74 | 75 | ||
75 | if not branches: | 76 | if not branches: |
76 | raise LayerIndexFetchError("No branches specified for _load_bblayers!") | 77 | raise layerindexlib.LayerIndexFetchError("No branches specified for _load_bblayers!") |
77 | 78 | ||
78 | index = layerindexlib.LayerIndexObj() | 79 | index = layerindexlib.LayerIndexObj() |
79 | 80 | ||
@@ -202,7 +203,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): | |||
202 | try: | 203 | try: |
203 | depDict = bb.utils.explode_dep_versions2(deps) | 204 | depDict = bb.utils.explode_dep_versions2(deps) |
204 | except bb.utils.VersionStringException as vse: | 205 | except bb.utils.VersionStringException as vse: |
205 | bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (c, str(vse))) | 206 | bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (collection, str(vse))) |
206 | 207 | ||
207 | for dep, oplist in list(depDict.items()): | 208 | for dep, oplist in list(depDict.items()): |
208 | # We need to search ourselves, so use the _ version... | 209 | # We need to search ourselves, so use the _ version... |
@@ -268,7 +269,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): | |||
268 | 269 | ||
269 | layer = bb.utils.get_file_layer(realfn[0], self.config_data) | 270 | layer = bb.utils.get_file_layer(realfn[0], self.config_data) |
270 | 271 | ||
271 | depBranchId = collection_layerbranch[layer] | 272 | depBranchId = collection[layer] |
272 | 273 | ||
273 | recipeId += 1 | 274 | recipeId += 1 |
274 | recipe = layerindexlib.Recipe(index, None) | 275 | recipe = layerindexlib.Recipe(index, None) |
diff --git a/bitbake/lib/layerindexlib/restapi.py b/bitbake/lib/layerindexlib/restapi.py index 21fd144143..7023f42f20 100644 --- a/bitbake/lib/layerindexlib/restapi.py +++ b/bitbake/lib/layerindexlib/restapi.py | |||
@@ -5,9 +5,13 @@ | |||
5 | 5 | ||
6 | import logging | 6 | import logging |
7 | import json | 7 | import json |
8 | import os | ||
9 | |||
8 | from urllib.parse import unquote | 10 | from urllib.parse import unquote |
9 | from urllib.parse import urlparse | 11 | from urllib.parse import urlparse |
10 | 12 | ||
13 | import bb | ||
14 | |||
11 | import layerindexlib | 15 | import layerindexlib |
12 | import layerindexlib.plugin | 16 | import layerindexlib.plugin |
13 | 17 | ||
@@ -163,7 +167,7 @@ class RestApiPlugin(layerindexlib.plugin.IndexPlugin): | |||
163 | parsed = _get_json_response(apiurl=up_stripped.geturl(), username=username, password=password, retry=False) | 167 | parsed = _get_json_response(apiurl=up_stripped.geturl(), username=username, password=password, retry=False) |
164 | logger.debug(1, "%s: retry successful.") | 168 | logger.debug(1, "%s: retry successful.") |
165 | else: | 169 | else: |
166 | raise LayerIndexFetchError('%s: Connection reset by peer. Is there a firewall blocking your connection?' % apiurl) | 170 | raise layerindexlib.LayerIndexFetchError('%s: Connection reset by peer. Is there a firewall blocking your connection?' % apiurl) |
167 | 171 | ||
168 | return parsed | 172 | return parsed |
169 | 173 | ||
diff --git a/bitbake/lib/layerindexlib/tests/restapi.py b/bitbake/lib/layerindexlib/tests/restapi.py index e5ccafe5c9..4646d01f9f 100644 --- a/bitbake/lib/layerindexlib/tests/restapi.py +++ b/bitbake/lib/layerindexlib/tests/restapi.py | |||
@@ -112,7 +112,7 @@ class LayerIndexWebRestApiTest(LayersTest): | |||
112 | break | 112 | break |
113 | else: | 113 | else: |
114 | self.logger.debug(1, "meta-python was not found") | 114 | self.logger.debug(1, "meta-python was not found") |
115 | self.assetTrue(False) | 115 | raise self.failureException |
116 | 116 | ||
117 | # Only check the first element... | 117 | # Only check the first element... |
118 | break | 118 | break |
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: |
diff --git a/bitbake/lib/toaster/tests/functional/functional_helpers.py b/bitbake/lib/toaster/tests/functional/functional_helpers.py index 455c408e94..5c4ea71794 100644 --- a/bitbake/lib/toaster/tests/functional/functional_helpers.py +++ b/bitbake/lib/toaster/tests/functional/functional_helpers.py | |||
@@ -75,7 +75,7 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase): | |||
75 | try: | 75 | try: |
76 | table_element = self.get_table_element(table_id) | 76 | table_element = self.get_table_element(table_id) |
77 | element = table_element.find_element_by_link_text(link_text) | 77 | element = table_element.find_element_by_link_text(link_text) |
78 | except NoSuchElementException as e: | 78 | except self.NoSuchElementException: |
79 | print('no element found') | 79 | print('no element found') |
80 | raise | 80 | raise |
81 | return element | 81 | return element |
@@ -86,7 +86,7 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase): | |||
86 | element_xpath = "//*[@id='" + table_id + "']" | 86 | element_xpath = "//*[@id='" + table_id + "']" |
87 | try: | 87 | try: |
88 | element = self.driver.find_element_by_xpath(element_xpath) | 88 | element = self.driver.find_element_by_xpath(element_xpath) |
89 | except NoSuchElementException as e: | 89 | except self.NoSuchElementException: |
90 | raise | 90 | raise |
91 | return element | 91 | return element |
92 | row = coordinate[0] | 92 | row = coordinate[0] |
@@ -96,7 +96,7 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase): | |||
96 | element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]" | 96 | element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]" |
97 | try: | 97 | try: |
98 | element = self.driver.find_element_by_xpath(element_xpath) | 98 | element = self.driver.find_element_by_xpath(element_xpath) |
99 | except NoSuchElementException as e: | 99 | except self.NoSuchElementException: |
100 | return False | 100 | return False |
101 | return element | 101 | return element |
102 | #now we are looking for an element with specified X and Y | 102 | #now we are looking for an element with specified X and Y |
@@ -105,6 +105,6 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase): | |||
105 | element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]/td[" + str(column) + "]" | 105 | element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]/td[" + str(column) + "]" |
106 | try: | 106 | try: |
107 | element = self.driver.find_element_by_xpath(element_xpath) | 107 | element = self.driver.find_element_by_xpath(element_xpath) |
108 | except NoSuchElementException as e: | 108 | except self.NoSuchElementException: |
109 | return False | 109 | return False |
110 | return element | 110 | return element |