diff --git a/dist/pythonlibs/testrunner/__init__.py b/dist/pythonlibs/testrunner/__init__.py
index 8678b90b1307469b025442f3765da3bcfc9d946c..9d16cb3df76622531e1cbc673b3e04e2b7cd29ec 100755
--- a/dist/pythonlibs/testrunner/__init__.py
+++ b/dist/pythonlibs/testrunner/__init__.py
@@ -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)