summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--bitbake/lib/bb/__init__.py2
-rw-r--r--bitbake/lib/bb/daemonize.py2
-rw-r--r--bitbake/lib/bb/data_smart.py2
-rw-r--r--bitbake/lib/bb/fetch2/osc.py3
-rw-r--r--bitbake/lib/bb/fetch2/ssh.py7
-rw-r--r--bitbake/lib/bb/msg.py1
-rw-r--r--bitbake/lib/bb/namedtuple_with_abc.py14
-rw-r--r--bitbake/lib/bb/process.py1
-rw-r--r--bitbake/lib/bb/server/process.py1
-rw-r--r--bitbake/lib/bb/tests/data.py1
-rw-r--r--bitbake/lib/bb/tinfoil.py2
-rw-r--r--bitbake/lib/bb/ui/knotty.py2
-rw-r--r--bitbake/lib/bb/ui/ncurses.py2
-rw-r--r--bitbake/lib/bb/ui/uievent.py6
-rw-r--r--bitbake/lib/hashserv/tests.py1
-rw-r--r--bitbake/lib/layerindexlib/__init__.py15
-rw-r--r--bitbake/lib/layerindexlib/cooker.py7
-rw-r--r--bitbake/lib/layerindexlib/restapi.py6
-rw-r--r--bitbake/lib/layerindexlib/tests/restapi.py2
-rw-r--r--bitbake/lib/ply/lex.py6
-rw-r--r--bitbake/lib/ply/yacc.py2
-rw-r--r--bitbake/lib/toaster/tests/functional/functional_helpers.py8
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
99logging.LoggerAdapter = BBLoggerAdapter 99logging.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
14import io 14import io
15import traceback 15import traceback
16 16
17import bb
18
17def createDaemon(function, logfile): 19def 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
10import logging 10import logging
11import os
11import bb 12import bb
12from bb.fetch2 import FetchMethod 13from bb.fetch2 import FetchMethod
13from bb.fetch2 import FetchError 14from bb.fetch2 import FetchError
14from bb.fetch2 import MissingParameterError 15from bb.fetch2 import MissingParameterError
15from bb.fetch2 import runfetchcmd 16from bb.fetch2 import runfetchcmd
16 17
18logger = logging.getLogger(__name__)
19
17class Osc(FetchMethod): 20class 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
33import re, os 33import re, os
34from bb.fetch2 import FetchMethod 34from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd
35from 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
14import copy 14import copy
15import logging 15import logging
16import logging.config 16import logging.config
17import os
17from itertools import groupby 18from itertools import groupby
18import bb 19import bb
19import bb.event 20import 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
64exec( 64class _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
7import subprocess 7import subprocess
8import errno 8import errno
9import select 9import select
10import bb
10 11
11logger = logging.getLogger('BitBake.Process') 12logger = 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
25import errno 25import errno
26import re 26import re
27import datetime 27import datetime
28import pickle
28import bb.server.xmlrpcserver 29import bb.server.xmlrpcserver
29from bb import daemonize 30from bb import daemonize
30from multiprocessing import queues 31from 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
12import bb.data 12import bb.data
13import bb.parse 13import bb.parse
14import logging 14import logging
15import os
15 16
16class LogRecord(): 17class 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
48import xmlrpc.client 48import xmlrpc.client
49from bb.ui import uihelper 49from bb.ui import uihelper
50 50
51logger = logging.getLogger(__name__)
52
51parsespin = itertools.cycle( r'|/-\\' ) 53parsespin = itertools.cycle( r'|/-\\' )
52 54
53X = 0 55X = 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
11client/server deadlocks. 11client/server deadlocks.
12""" 12"""
13 13
14import socket, threading, pickle, collections 14import collections, logging, pickle, socket, threading
15from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler 15from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
16 16
17import bb
18
19logger = logging.getLogger(__name__)
20
17class BBUIEventQueue: 21class 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
9import hashlib 9import hashlib
10import logging 10import logging
11import multiprocessing 11import multiprocessing
12import os
12import sys 13import sys
13import tempfile 14import tempfile
14import threading 15import 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
8import logging 8import logging
9import imp 9import imp
10import os
10 11
11from collections import OrderedDict 12from collections import OrderedDict
12from layerindexlib.plugin import LayerIndexPluginUrlError 13from 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
6import logging 6import logging
7import os
7 8
8from collections import defaultdict 9from 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
6import logging 6import logging
7import json 7import json
8import os
9
8from urllib.parse import unquote 10from urllib.parse import unquote
9from urllib.parse import urlparse 11from urllib.parse import urlparse
10 12
13import bb
14
11import layerindexlib 15import layerindexlib
12import layerindexlib.plugin 16import 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