Commit adb678ea authored by John Kirkwood's avatar John Kirkwood

Use os.path for generic path separators.

parent 479914cd
Pipeline #2559 passed with stages
in 36 seconds
......@@ -2,6 +2,7 @@ import collections
import inspect
import colorama
import pprint
import os.path
import sys
import types
......@@ -107,7 +108,7 @@ class ConsoleScript(BaseGroup):
def __init__(self, doc=None, argv=None, default_command='help'):
ConsoleScript.singleton = self
argv = argv if argv is not None else sys.argv
super().__init__(argv[0].split('/')[-1], doc, default_command)
super().__init__(os.path.basename(argv[0]), doc, default_command)
self.argv = argv
self.exit_code = 0
self.add_help()
......
......@@ -76,7 +76,8 @@ def autotest(path, cmd, ignore=None):
exists = False
if not exists:
dirname = '/'.join(path.split('/')[:-1])
# dirname = '/'.join(path.split('/')[:-1])
dirname = os.path.dirname(path)
if not os.path.exists(dirname):
os.makedirs(dirname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment