Skip some importlib tests on windows + fix weird errors, hopefully?

This commit is contained in:
Noah committed 2020-11-02 12:42:44 -06:00
1 parent 9105c44bc1
commit 606d8196b6
3 files changed
+15 -7

No files matched your search

+4 -1
View File
@@ -43,7 +43,10 @@ _IGNORED_WINERRORS = (
)
def _ignore_error(exception):
return (getattr(exception, 'errno', None) in _IGNORED_ERROS or
# XXX RUSTPYTHON: added check for FileNotFoundError, file.exists() on windows throws it
# but with a errno==ESRCH for some reason
return (isinstance(exception, FileNotFoundError) or
getattr(exception, 'errno', None) in _IGNORED_ERROS or
getattr(exception, 'winerror', None) in _IGNORED_WINERRORS)
+9 -6
View File
@@ -1066,12 +1066,15 @@ def temp_dir(path=None, quiet=False):
try:
rmtree(path)
except OSError as exc:
# XXX RUSTPYTHON: added quiet check here, not sure why rmtree fails on windows
if not quiet:
raise
warnings.warn(f'unable to remove temporary'
f'directory {path!r}: {exc}',
RuntimeWarning, stacklevel=3)
# XXX RUSTPYTHON: something something async file removal?
# also part of the thing with rmtree()
# throwing PermissionError, I think
if os.path.exists(path):
if not quiet:
raise
warnings.warn(f'unable to remove temporary'
f'directory {path!r}: {exc}',
RuntimeWarning, stacklevel=3)
@contextlib.contextmanager
def change_cwd(path, quiet=False):
+2
View File
@@ -88,6 +88,8 @@ class WindowsRegistryFinderTests:
@unittest.skipUnless(sys.platform.startswith('win'), 'requires Windows')
class WindowsExtensionSuffixTests:
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_tagged_suffix(self):
suffixes = self.machinery.EXTENSION_SUFFIXES
expected_tag = ".cp{0.major}{0.minor}-{1}.pyd".format(sys.version_info,