Skip to content

Commit 67d0631

Browse files
wonder-miceByron
authored andcommitted
import unittest adds 0.250s to script launch time
This should not be imported at root level, since it adds a lot of initialization overhead without need.
1 parent e24f9b7 commit 67d0631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: git/objects/submodule/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import logging
44
import os
55
import stat
6-
7-
from unittest import SkipTest
86
import uuid
97

108
import git
@@ -934,6 +932,7 @@ def remove(self, module: bool = True, force: bool = False,
934932
rmtree(str(wtd))
935933
except Exception as ex:
936934
if HIDE_WINDOWS_KNOWN_ERRORS:
935+
from unittest import SkipTest
937936
raise SkipTest("FIXME: fails with: PermissionError\n {}".format(ex)) from ex
938937
raise
939938
# END delete tree if possible
@@ -945,6 +944,7 @@ def remove(self, module: bool = True, force: bool = False,
945944
rmtree(git_dir)
946945
except Exception as ex:
947946
if HIDE_WINDOWS_KNOWN_ERRORS:
947+
from unittest import SkipTest
948948
raise SkipTest(f"FIXME: fails with: PermissionError\n {ex}") from ex
949949
else:
950950
raise

0 commit comments

Comments
 (0)