Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit68d1086

Browse files
committed
readers: fix undefined FileNotFoundError and NotADirectoryError on Python 2
Signed-off-by: Filipe Laíns <lains@archlinux.org>
1 parent0410296 commit68d1086

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

‎importlib_resources/_compat.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ class ABC(object): # type: ignore
3636
FileNotFoundError=OSError# type: ignore
3737

3838

39+
try:
40+
NotADirectoryError=NotADirectoryError# type: ignore
41+
exceptNameError:
42+
NotADirectoryError=OSError# type: ignore
43+
44+
3945
try:
4046
fromzipfileimportPathasZipPath# type: ignore
4147
exceptImportError:

‎importlib_resources/readers.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .importabc
66

77
from ._compatimportPath,ZipPath
8+
from ._compatimportFileNotFoundError,NotADirectoryError
89

910

1011
classFileReader(abc.TraversableResources):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp