Speedup: Use faster importlib.metadata for getting version
This commit is contained in:
parent
d3ee0e4942
commit
b48fbb4eb8
2 changed files with 10 additions and 2 deletions
|
@ -33,13 +33,18 @@ from http.client import HTTPSConnection
|
|||
from urllib.parse import quote_plus
|
||||
from xml.dom import Node, minidom
|
||||
|
||||
import pkg_resources
|
||||
try:
|
||||
# Python 3.8+
|
||||
import importlib.metadata as importlib_metadata
|
||||
except ImportError:
|
||||
# Python 3.7 and lower
|
||||
import importlib_metadata
|
||||
|
||||
__author__ = "Amr Hassan, hugovk, Mice Pápai"
|
||||
__copyright__ = "Copyright (C) 2008-2010 Amr Hassan, 2013-2021 hugovk, 2017 Mice Pápai"
|
||||
__license__ = "apache2"
|
||||
__email__ = "amr.hassan@gmail.com"
|
||||
__version__ = pkg_resources.get_distribution(__name__).version
|
||||
__version__ = importlib_metadata.version(__name__)
|
||||
|
||||
|
||||
# 1 : This error does not exist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue