diff -Nru objgraph-3.5.0/debian/changelog objgraph-3.5.0/debian/changelog --- objgraph-3.5.0/debian/changelog 2021-09-18 04:07:55.000000000 +0000 +++ objgraph-3.5.0/debian/changelog 2021-10-22 17:52:42.000000000 +0000 @@ -1,3 +1,10 @@ +objgraph (3.5.0-4) unstable; urgency=medium + + * Patch: Avoid a py2-style exec in sphinx docs/conf.py, instead parse the + version from the objgraph.py. Fixes FTBFS with python3-sphinx 4. + + -- Stefano Rivera Fri, 22 Oct 2021 10:52:42 -0700 + objgraph (3.5.0-3) unstable; urgency=medium [ Debian Janitor ] diff -Nru objgraph-3.5.0/debian/patches/py3-sphinx objgraph-3.5.0/debian/patches/py3-sphinx --- objgraph-3.5.0/debian/patches/py3-sphinx 1970-01-01 00:00:00.000000000 +0000 +++ objgraph-3.5.0/debian/patches/py3-sphinx 2021-10-22 17:52:42.000000000 +0000 @@ -0,0 +1,58 @@ +From: Marius Gedminas +Date: Fri, 22 Oct 2021 10:33:44 -0700 +Subject: Extract version from objgraph.py without py2 exec + +Origin: upstream, https://github.com/mgedmin/objgraph/commit/e96d904f09278ef1a32eb666fb1db7d0d3c778db +--- + docs/conf.py | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/docs/conf.py b/docs/conf.py +index bd7c083..85c5a5d 100644 +--- a/docs/conf.py ++++ b/docs/conf.py +@@ -11,25 +11,40 @@ + # All configuration values have a default; values that are commented out + # serve to show the default. + +-import sys, os ++import io ++import os ++import re ++import sys + + # If extensions (or modules to document with autodoc) are in another directory, + # add these directories to sys.path here. If the directory is relative to the + # documentation root, use os.path.abspath to make it absolute, like shown here. + sys.path.append(os.path.abspath('..')) + ++ + def relative(filename): + here = os.path.dirname('__file__') + return os.path.join(here, filename) + ++ ++def read(filename): ++ with io.open(relative(filename), encoding='UTF-8') as f: ++ return f.read() ++ ++ + def get_version(): +- d = {} +- exec open(relative('../objgraph.py')).read() in d +- return d['__version__'] ++ r = re.compile('''^__version__ = ["'](.+)["']$''') ++ for line in read('../objgraph.py').splitlines(): ++ m = r.match(line) ++ if m: ++ return m.group(1) ++ raise AssertionError('Could not determine version number from objgraph.py') ++ + + def get_short_version(): + return '.'.join(get_version().split('.')[:2]) + ++ + # -- General configuration ----------------------------------------------------- + + # Add any Sphinx extension module names here, as strings. They can be extensions diff -Nru objgraph-3.5.0/debian/patches/series objgraph-3.5.0/debian/patches/series --- objgraph-3.5.0/debian/patches/series 2021-09-18 04:07:55.000000000 +0000 +++ objgraph-3.5.0/debian/patches/series 2021-10-22 17:52:42.000000000 +0000 @@ -1,2 +1,3 @@ remove-external-images no-graphviz +py3-sphinx