Commit fc310cf7 authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

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

parent 50fe6655
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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: