Skip to content

Commit 602c864

Browse files
committed
Check if an attribute is defined before using it
1 parent e337755 commit 602c864

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8000,15 +8000,15 @@ def _print(self, msg):
80008000
To force a print during multithreaded tests, use: "sys.stderr.write()".
80018001
To print without the new-line character end, use: "sys.stdout.write()".
80028002
"""
8003-
if not sb_config._multithreaded:
8004-
print(msg)
8005-
else:
8003+
if hasattr(sb_config, "_multithreaded") and sb_config._multithreaded:
80068004
if type(msg) is not str:
80078005
try:
80088006
msg = str(msg)
80098007
except Exception:
80108008
pass
80118009
sys.stderr.write(msg + "\n")
8010+
else:
8011+
print(msg)
80128012

80138013
def start_tour(self, name=None, interval=0):
80148014
self.play_tour(name=name, interval=interval)

0 commit comments

Comments
 (0)