diff --git a/postgresql/__init__.py b/postgresql/__init__.py index 60ce8e5..1af6316 100644 --- a/postgresql/__init__.py +++ b/postgresql/__init__.py @@ -10,8 +10,6 @@ for information about Python. """ __all__ = [ - '__author__', - '__date__', '__version__', '__docformat__', 'version', @@ -27,11 +25,10 @@ # Optional. try: - from .project import version_info, version, \ - author as __author__, date as __date__ - __version__ = version + from .project import version_info, version except ImportError: pass +__version__ = version # Avoid importing these until requested. _pg_iri = _pg_driver = _pg_param = None diff --git a/postgresql/bin/pg_dotconf.py b/postgresql/bin/pg_dotconf.py index 31306e9..06599a6 100644 --- a/postgresql/bin/pg_dotconf.py +++ b/postgresql/bin/pg_dotconf.py @@ -39,8 +39,8 @@ def command(args): for line in sf: pl = configfile.parse_line(line) if pl is not None: - if comment not in line[pl[0].start]: - settings[line[pl[0]]] = unquote(line[pl[1]]) + if configfile.comment not in line[:pl[0].start]: + settings[line[pl[0]]] = configfile.unquote(line[pl[1]]) prev = None for p in ca[1:]: diff --git a/postgresql/python/command.py b/postgresql/python/command.py index d88b154..e040659 100644 --- a/postgresql/python/command.py +++ b/postgresql/python/command.py @@ -57,7 +57,17 @@ from gettext import gettext as _ from traceback import print_exception -from pkgutil import get_loader as module_loader +from importlib.util import find_spec + +def module_loader(name): + """ + Return the loader of the named module, or None if it cannot be found. + (Replaces pkgutil.get_loader, which was removed in Python 3.14.) + """ + spec = find_spec(name) + if spec is None: + return None + return spec.loader class single_loader(object): """