diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-06-09 20:05:20 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-06-10 09:31:46 +0200 |
commit | b071e8808e703ed0cb4354452b0b5d024da5967c (patch) | |
tree | db4444a5d74a3d51237a243b5ac070a9a216d740 /dev-python/nbconvert | |
parent | dev-python/nbformat: Port to py3.9 (diff) | |
download | gentoo-b071e8808e703ed0cb4354452b0b5d024da5967c.tar.gz gentoo-b071e8808e703ed0cb4354452b0b5d024da5967c.tar.bz2 gentoo-b071e8808e703ed0cb4354452b0b5d024da5967c.zip |
dev-python/nbconvert: Port to py3.9
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/nbconvert')
-rw-r--r-- | dev-python/nbconvert/files/nbconvert-5.6.1-py39.patch | 27 | ||||
-rw-r--r-- | dev-python/nbconvert/nbconvert-5.6.1.ebuild | 3 |
2 files changed, 29 insertions, 1 deletions
diff --git a/dev-python/nbconvert/files/nbconvert-5.6.1-py39.patch b/dev-python/nbconvert/files/nbconvert-5.6.1-py39.patch new file mode 100644 index 000000000000..822c32753f83 --- /dev/null +++ b/dev-python/nbconvert/files/nbconvert-5.6.1-py39.patch @@ -0,0 +1,27 @@ +diff --git a/nbconvert/filters/strings.py b/nbconvert/filters/strings.py +index 2673d661..9ae82a13 100755 +--- a/nbconvert/filters/strings.py ++++ b/nbconvert/filters/strings.py +@@ -19,8 +19,8 @@ except ImportError: + from urllib2 import quote # Py 2 + + # defusedxml does safe(r) parsing of untrusted XML data +-from defusedxml import cElementTree as ElementTree +-from xml.etree.cElementTree import Element ++from defusedxml import ElementTree ++from xml.etree.ElementTree import Element + + from ipython_genutils import py3compat + +diff --git a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py +index aff14d9f..b689b1bc 100644 +--- a/nbconvert/preprocessors/svg2pdf.py ++++ b/nbconvert/preprocessors/svg2pdf.py +@@ -105,6 +105,6 @@ class SVG2PDFPreprocessor(ConvertFiguresPreprocessor): + if os.path.isfile(output_filename): + with open(output_filename, 'rb') as f: + # PDF is a nb supported binary, data type, so base64 encode. +- return base64.encodestring(f.read()) ++ return base64.encodebytes(f.read()) + else: + raise TypeError("Inkscape svg to pdf conversion failed") diff --git a/dev-python/nbconvert/nbconvert-5.6.1.ebuild b/dev-python/nbconvert/nbconvert-5.6.1.ebuild index 0a81b48e8e27..594d35db111d 100644 --- a/dev-python/nbconvert/nbconvert-5.6.1.ebuild +++ b/dev-python/nbconvert/nbconvert-5.6.1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{6,7} ) +PYTHON_COMPAT=( python3_{6..9} ) inherit distutils-r1 @@ -44,6 +44,7 @@ distutils_enable_tests pytest PATCHES=( "${FILESDIR}"/${P}-inkscape-1.patch + "${FILESDIR}"/${P}-py39.patch ) src_prepare() { |