mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5487 from jdufresne/plist
Remove plistlib workaround for unsupported Pythons
This commit is contained in:
commit
23c2273060
@ -35,13 +35,6 @@ if False:
|
||||
|
||||
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)
|
||||
access_page_template = '''\
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\
|
||||
@ -173,7 +166,7 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
|
||||
|
||||
logger.info(bold(__('writing Info.plist... ')), nonl=True)
|
||||
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'))
|
||||
|
||||
# Copy the icon, if one is supplied
|
||||
|
@ -17,12 +17,6 @@ import pytest
|
||||
|
||||
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):
|
||||
contentsdir = outdir / 'Contents'
|
||||
@ -30,7 +24,7 @@ def check_structure(outdir):
|
||||
assert (contentsdir / 'Info.plist').isfile()
|
||||
|
||||
with open(contentsdir / 'Info.plist', 'rb') as f:
|
||||
plist = read_plist(f)
|
||||
plist = plistlib.load(f)
|
||||
assert plist
|
||||
assert len(plist)
|
||||
assert plist.get('CFBundleIdentifier', None) == 'org.sphinx-doc.Sphinx.help'
|
||||
|
Loading…
Reference in New Issue
Block a user