1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

testrunner: fix script when RIOTBASE is not defined

If not defined it was raising a KeyError. Use the 'get' function to
handle non defined value.

It did not put the value in the `default` case as it would have changed
the behavior when `RIOTBASE` is defined but empty.
This commit is contained in:
cladmi 2018-10-20 02:20:33 +02:00 committed by Gaëtan Harter
parent fc1baddef8
commit 921afa0820
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -16,8 +16,9 @@ from traceback import extract_tb, print_tb
import pexpect
PEXPECT_PATH = os.path.dirname(pexpect.__file__)
RIOTBASE = os.environ['RIOTBASE'] or \
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
RIOTBASE = (os.environ.get('RIOTBASE') or
os.path.abspath(os.path.join(os.path.dirname(__file__),
"..", "..", "..")))
# Setting an empty 'TESTRUNNER_START_DELAY' environment variable use the
# default value (3)