Merge pull request #5487 from jdufresne/plist

Remove plistlib workaround for unsupported Pythons
This commit is contained in:
Takeshi KOMIYA 2018-09-25 08:28:21 +09:00 committed by GitHub
commit 23c2273060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 15 deletions

View File

@ -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

View File

@ -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'