mirror of
https://git.rtems.org/rtems-docs/
synced 2025-10-21 04:05:58 +08:00
common/latex.py: use distro module for python3.5 and up
This commit is contained in:
@@ -3,8 +3,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import platform
|
|
||||||
import re
|
import re
|
||||||
|
try:
|
||||||
|
from distro import linux_distribution
|
||||||
|
except:
|
||||||
|
from platform import linux_distribution
|
||||||
|
|
||||||
package_test_preamble = ['\\newif\\ifsphinxKeepOldNames \\sphinxKeepOldNamestrue',
|
package_test_preamble = ['\\newif\\ifsphinxKeepOldNames \\sphinxKeepOldNamestrue',
|
||||||
'\documentclass[a4paper,11pt,english]{report}']
|
'\documentclass[a4paper,11pt,english]{report}']
|
||||||
@@ -82,7 +85,7 @@ def tex_test(test):
|
|||||||
def host_name():
|
def host_name():
|
||||||
uname = os.uname()
|
uname = os.uname()
|
||||||
if uname[0] == 'Linux':
|
if uname[0] == 'Linux':
|
||||||
distro = platform.dist()
|
distro = linux_distribution()
|
||||||
name = '%s/%s' % (uname[0], distro[0])
|
name = '%s/%s' % (uname[0], distro[0])
|
||||||
version = distro[1]
|
version = distro[1]
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user