File: python3-sphinx.diff

package info (click to toggle)
libgnatcoll 18-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,068 kB
  • sloc: ada: 40,393; python: 354; ansic: 310; makefile: 245; sh: 31
file content (17 lines) | stat: -rw-r--r-- 650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Description: replace obsolete file() constructor with a context manager.
 Replace file(), specific to python2, with a context manager that
 also closes the file after use.
Author: Nicolas Boulenguez <nicolas@debian.org>

--- a/docs/conf.py
+++ b/docs/conf.py
@@ -48,7 +48,8 @@
 
 def get_version():
     """Extract the version from configure.in"""
-    return file("../version_information").read().strip()
+    with open ("../version_information") as f:
+        return f.readline().strip()
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the