-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
912c751
commit 2116757
Showing
4 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,22 @@ | |
# This software is distributed under the terms of the MIT License. | ||
# Author: Pavel Kirienko <[email protected]> | ||
|
||
# Disabling unused ignores because we need to support differnt versions of importlib.resources. | ||
# mypy: warn_unused_ignores=False | ||
# pylint: disable=wrong-import-position | ||
|
||
import typing | ||
|
||
|
||
def _read_package_file(name: str) -> str: | ||
try: | ||
from importlib.resources import files | ||
from importlib.resources import files # type: ignore | ||
|
||
return (files(__name__) / name).read_text(encoding="utf8") | ||
return (files(__name__) / name).read_text(encoding="utf8") # type: ignore | ||
except ImportError: # This is for the old Pythons; read_text is deprecated in 3.11 | ||
from importlib.resources import read_text | ||
from importlib.resources import read_text # type: ignore | ||
|
||
return read_text(__name__, name, encoding="utf8") | ||
return read_text(__name__, name, encoding="utf8") # type: ignore | ||
|
||
|
||
__version__: str = _read_package_file("VERSION").strip() | ||
|