diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-23 19:20:58 -0700 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-23 20:25:36 -0700 |
commit | 65da8a08acaf3cabbb96b1c21f5e19f2efd032e9 (patch) | |
tree | a960da2bb0a91eec8e55e9814b478e8571e826dd | |
parent | ff8df59ac1f2a725ec9f6ebcb862de35487c8e25 (diff) | |
download | sphinx-git-65da8a08acaf3cabbb96b1c21f5e19f2efd032e9.tar.gz |
Remove plistlib workaround for unsupported Pythons
-rw-r--r-- | sphinx/builders/applehelp.py | 9 | ||||
-rw-r--r-- | tests/test_build_applehelp.py | 8 |
2 files changed, 2 insertions, 15 deletions
diff --git a/sphinx/builders/applehelp.py b/sphinx/builders/applehelp.py index 56e9bd6c0..b29ce3d95 100644 --- a/sphinx/builders/applehelp.py +++ b/sphinx/builders/applehelp.py @@ -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 diff --git a/tests/test_build_applehelp.py b/tests/test_build_applehelp.py index ed0022ce1..9c5d46941 100644 --- a/tests/test_build_applehelp.py +++ b/tests/test_build_applehelp.py @@ -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' |