mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove plistlib workaround for unsupported Pythons
This commit is contained in:
parent
ff8df59ac1
commit
65da8a08ac
@ -35,13 +35,6 @@ if False:
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Use plistlib.dump in 3.4 and above
|
|
||||||
try:
|
|
||||||
write_plist = plistlib.dump # type: ignore
|
|
||||||
except AttributeError:
|
|
||||||
write_plist = plistlib.writePlist
|
|
||||||
|
|
||||||
|
|
||||||
# False access page (used because helpd expects strict XHTML)
|
# False access page (used because helpd expects strict XHTML)
|
||||||
access_page_template = '''\
|
access_page_template = '''\
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\
|
||||||
@ -173,7 +166,7 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
|
|||||||
|
|
||||||
logger.info(bold(__('writing Info.plist... ')), nonl=True)
|
logger.info(bold(__('writing Info.plist... ')), nonl=True)
|
||||||
with open(path.join(contents_dir, 'Info.plist'), 'wb') as f:
|
with open(path.join(contents_dir, 'Info.plist'), 'wb') as f:
|
||||||
write_plist(info_plist, f)
|
plistlib.dump(info_plist, f) # type: ignore
|
||||||
logger.info(__('done'))
|
logger.info(__('done'))
|
||||||
|
|
||||||
# Copy the icon, if one is supplied
|
# Copy the icon, if one is supplied
|
||||||
|
@ -17,12 +17,6 @@ import pytest
|
|||||||
|
|
||||||
from sphinx.testing.path import path
|
from sphinx.testing.path import path
|
||||||
|
|
||||||
# Use plistlib.load in 3.4 and above
|
|
||||||
try:
|
|
||||||
read_plist = plistlib.load
|
|
||||||
except AttributeError:
|
|
||||||
read_plist = plistlib.readPlist
|
|
||||||
|
|
||||||
|
|
||||||
def check_structure(outdir):
|
def check_structure(outdir):
|
||||||
contentsdir = outdir / 'Contents'
|
contentsdir = outdir / 'Contents'
|
||||||
@ -30,7 +24,7 @@ def check_structure(outdir):
|
|||||||
assert (contentsdir / 'Info.plist').isfile()
|
assert (contentsdir / 'Info.plist').isfile()
|
||||||
|
|
||||||
with open(contentsdir / 'Info.plist', 'rb') as f:
|
with open(contentsdir / 'Info.plist', 'rb') as f:
|
||||||
plist = read_plist(f)
|
plist = plistlib.load(f)
|
||||||
assert plist
|
assert plist
|
||||||
assert len(plist)
|
assert len(plist)
|
||||||
assert plist.get('CFBundleIdentifier', None) == 'org.sphinx-doc.Sphinx.help'
|
assert plist.get('CFBundleIdentifier', None) == 'org.sphinx-doc.Sphinx.help'
|
||||||
|
Loading…
Reference in New Issue
Block a user