Skip to content
Snippets Groups Projects
Commit fc310cf7 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Ignore "--debug" and similar arguments when creating a hopefully-useful temporary directory suffix.

parent 50fe6655
No related merge requests found
......@@ -105,11 +105,13 @@ def _get_base_temporary_directory():
if _BASEDIR is None or not os.path.exists(_BASEDIR.name):
try:
# Try and generate a potentially-useful suffix to our temporary directory
filtered_argv = [x for x in sys.argv if not x.startswith("-")]
suffix = "_{}".format(
re.sub(
r"[^\w]",
"",
os.path.basename(os.path.dirname(sys.argv[-1])),
os.path.basename(os.path.dirname(filtered_argv[-1])),
)[-10:]
)
except IndexError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment