Просмотр исходного кода

Merge topic 'sphinx-python3'

69069cfb Utilities/Sphinx: Port documentation generation to python3 (#14886)
Brad King 11 лет назад
Родитель
Сommit
e0790c90c0
2 измененных файлов с 4 добавлено и 4 удалено
  1. 3 3
      Utilities/Sphinx/cmake.py
  2. 1 1
      Utilities/Sphinx/conf.py.in

+ 3 - 3
Utilities/Sphinx/cmake.py

@@ -80,12 +80,12 @@ class CMakeModule(Directive):
             settings.record_dependencies.add(path)
             f = io.FileInput(source_path=path, encoding=encoding,
                              error_handler=e_handler)
-        except UnicodeEncodeError, error:
+        except UnicodeEncodeError as error:
             raise self.severe('Problems with "%s" directive path:\n'
                               'Cannot encode input file path "%s" '
                               '(wrong locale?).' %
                               (self.name, SafeString(path)))
-        except IOError, error:
+        except IOError as error:
             raise self.severe('Problems with "%s" directive path:\n%s.' %
                       (self.name, ErrorString(error)))
         raw_lines = f.read().splitlines()
@@ -323,7 +323,7 @@ class CMakeDomain(Domain):
                             contnode, target)
 
     def get_objects(self):
-        for refname, (docname, type) in self.data['objects'].iteritems():
+        for refname, (docname, type) in self.data['objects'].items():
             yield (refname, refname, type, docname, refname, 1)
 
 def setup(app):

+ 1 - 1
Utilities/Sphinx/conf.py.in

@@ -50,7 +50,7 @@ for fpath in cmake_manuals:
                               name, desc, [], int(sec)))
         else:
             sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
-    except Exception, e:
+    except Exception as e:
         sys.stderr.write("ERROR: %s\n" % str(e))
 man_show_urls = False