1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Description: adapt extraction of version for doc to python3-sphinx
The name of this patch is historical.
Author: Nicolas Boulenguez <nicolas@debian.org>
--- a/docs/programmers_guide/conf.py
+++ b/docs/programmers_guide/conf.py
@@ -50,7 +50,8 @@
"""Extract the version from VERSION.txt"""
version_file = "../../VERSION.txt"
if os.path.isfile(version_file):
- return file(version_file).readline()
+ with open (version_file) as f:
+ return f.readline()
else:
return "0.0"
--- a/docs/tutorial/conf.py
+++ b/docs/tutorial/conf.py
@@ -50,7 +50,8 @@
"""Extract the version from VERSION.txt"""
version_file = "../../VERSION.txt"
if os.path.isfile(version_file):
- return file(version_file).readline()
+ with open (version_file) as f:
+ return f.readline()
else:
return "0.0"
--- a/docs/users_guide/conf.py
+++ b/docs/users_guide/conf.py
@@ -63,7 +63,8 @@
"""Extract the version from VERSION.txt"""
version_file = "../../VERSION.txt"
if os.path.isfile(version_file):
- return file(version_file).readline()
+ with open (version_file) as f:
+ return f.readline()
else:
return "0.0"
--- a/gnatdoc/docs/users_guide/conf.py
+++ b/gnatdoc/docs/users_guide/conf.py
@@ -52,7 +52,8 @@
"""Extract the version from VERSION.txt"""
version_file = "../../../VERSION.txt"
if os.path.isfile(version_file):
- return file(version_file).readline()
+ with open (version_file) as f:
+ return f.readline()
raise Exception("Cannot find version number")
# The version info for the project you're documenting, acts as replacement for
|