← 输入框|github.com|刷新
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions postgresql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
for information about Python.
"""
__all__ = [
'__author__',
'__date__',
'__version__',
'__docformat__',
'version',
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions postgresql/bin/pg_dotconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]:
Expand Down
12 changes: 11 additions & 1 deletion postgresql/python/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down