mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Specify the target Python version in the mypy configuration
Currently targets Python 3.5. This caught a bug. The subprocess.run() function only started taking the 'encoding' keyword argument starting with Python 3.6.
This commit is contained in:
parent
47cd262b3e
commit
acb2eadc8e
@ -40,6 +40,7 @@ paths =
|
|||||||
.
|
.
|
||||||
|
|
||||||
[mypy]
|
[mypy]
|
||||||
|
python_version = 3.5
|
||||||
show_column_numbers = True
|
show_column_numbers = True
|
||||||
show_error_context = True
|
show_error_context = True
|
||||||
ignore_missing_imports = True
|
ignore_missing_imports = True
|
||||||
|
@ -56,8 +56,8 @@ if __version__.endswith('+'):
|
|||||||
__version__ = __version__[:-1] # remove '+' for PEP-440 version spec.
|
__version__ = __version__[:-1] # remove '+' for PEP-440 version spec.
|
||||||
try:
|
try:
|
||||||
ret = subprocess.run(['git', 'show', '-s', '--pretty=format:%h'],
|
ret = subprocess.run(['git', 'show', '-s', '--pretty=format:%h'],
|
||||||
stdout=PIPE, stderr=PIPE, encoding='ascii')
|
stdout=PIPE, stderr=PIPE)
|
||||||
if ret.stdout:
|
if ret.stdout:
|
||||||
__display_version__ += '/' + ret.stdout.strip()
|
__display_version__ += '/' + ret.stdout.decode('ascii').strip()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user