Remove python2 vestiges from conf.py, traffic-server.py.
authorAlan M. Carroll <amc@apache.org>
Sat, 21 May 2022 17:28:31 +0000 (18:28 +0100)
committerJean Baptiste Favre <debian@jbfavre.org>
Sat, 21 May 2022 17:28:31 +0000 (18:28 +0100)
Origin: upstream
Applied-Upstream: https://github.com/apache/trafficserver/commit/096b2590b6111dd16ec19ca24f88ff41d069f2d0
Reviewed-by: Jean Baptiste Favre <jbfavre@debian.org>
Last-Update: 2020-07-29

Last-Update: 2020-07-29
Gbp-Pq: Name 0017-fix_sphinx_3.0.patch

doc/conf.py
doc/ext/traffic-server.py

index 0a8449dff845afb22bf1247a0f628e5ee8b6452e..db5ac0217ca69285e4ed68ee95bbc8d0feea246f 100644 (file)
@@ -57,7 +57,9 @@ extensions = [
 ]
 
 # Contains values that are dependent on configure.ac.
-execfile('ext/local-config.py')
+LOCAL_CONFIG = 'ext/local-config.py'
+with open(LOCAL_CONFIG) as f :
+    exec(compile(f.read(), LOCAL_CONFIG, 'exec'))
 
 if version_info >= (1, 4):
     extensions.append('sphinx.ext.imgmath')
@@ -114,7 +116,7 @@ gettext_compact = False
 # Generate .mo files just in time
 if os.environ.get('READTHEDOCS') == 'True':
     import polib
-    print "Generating .mo files",
+    print("Generating .mo files"),
     for locale_dir in locale_dirs:
         for path, dummy, filenames in os.walk(locale_dir):
             for filename in filenames:
@@ -124,7 +126,7 @@ if os.environ.get('READTHEDOCS') == 'True':
                     mo_file = base + ".mo"
                     po = polib.pofile(po_file)
                     po.save_as_mofile(fpath=mo_file)
-    print "done"
+    print("done")
 else:
     # On RedHat-based distributions, install the python-sphinx_rtd_theme package
     # to get an end result tht looks more like readthedoc.org.
@@ -213,7 +215,7 @@ class Inliner(states.Inliner):
                                        punctuation_chars.closers))
 
         issue = re.compile(
-            ur'''
+            r'''
       {start_string_prefix}
       TS-\d+
       {end_string_suffix}'''.format(
@@ -344,9 +346,9 @@ latex_elements = {
     #'preamble': '',
 }
 
-if tags.has('latex_a4'):
+if 'latex_a4' in tags:
     latex_elements['papersize'] = 'a4paper'
-elif tags.has('latex_paper'):
+elif 'latex_paper' in tags:
     latex_elements['papersiize'] = 'letterpaper'
 
 # Grouping the document tree into LaTeX files. List of tuples
index 59ead26ee2e25c231dada0fe9677a1e0458c77fd..7a07e15b4b10b0c74fc2a221656b2c1bce76e2cd 100644 (file)
@@ -31,7 +31,7 @@ from docutils.parsers import rst
 from docutils.parsers.rst import directives
 from sphinx.domains import Domain, ObjType, std
 from sphinx.roles import XRefRole
-from sphinx.locale import l_, _
+from sphinx.locale import _
 import sphinx
 
 import subprocess
@@ -301,8 +301,8 @@ class TrafficServerDomain(Domain):
     data_version = 2
 
     object_types = {
-        'cv': ObjType(l_('configuration variable'), 'cv'),
-        'stat': ObjType(l_('statistic'), 'stat')
+        'cv': ObjType(_('configuration variable'), 'cv'),
+        'stat': ObjType(_('statistic'), 'stat')
     }
 
     directives = {