Skip to content

Commit e24f9b7

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 35e302d commit e24f9b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: git/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import stat
2121
from sys import maxsize
2222
import time
23-
from unittest import SkipTest
2423
from urllib.parse import urlsplit, urlunsplit
2524
import warnings
2625

@@ -130,6 +129,7 @@ def onerror(func: Callable, path: PathLike, exc_info: str) -> None:
130129
func(path) # Will scream if still not possible to delete.
131130
except Exception as ex:
132131
if HIDE_WINDOWS_KNOWN_ERRORS:
132+
from unittest import SkipTest
133133
raise SkipTest("FIXME: fails with: PermissionError\n {}".format(ex)) from ex
134134
raise
135135

0 commit comments

Comments
 (0)