Skip to content

import unittest adds 0.250s to script launch time #1398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions git/objects/submodule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import logging
import os
import stat

from unittest import SkipTest
import uuid

import git
Expand Down Expand Up @@ -934,6 +932,7 @@ def remove(self, module: bool = True, force: bool = False,
rmtree(str(wtd))
except Exception as ex:
if HIDE_WINDOWS_KNOWN_ERRORS:
from unittest import SkipTest
raise SkipTest("FIXME: fails with: PermissionError\n {}".format(ex)) from ex
raise
# END delete tree if possible
Expand All @@ -945,6 +944,7 @@ def remove(self, module: bool = True, force: bool = False,
rmtree(git_dir)
except Exception as ex:
if HIDE_WINDOWS_KNOWN_ERRORS:
from unittest import SkipTest
raise SkipTest(f"FIXME: fails with: PermissionError\n {ex}") from ex
else:
raise
Expand Down
2 changes: 1 addition & 1 deletion git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import stat
from sys import maxsize
import time
from unittest import SkipTest
from urllib.parse import urlsplit, urlunsplit
import warnings

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

Expand Down