Skip to content

Commit 20b3da5

Browse files
committed
Fix #2470: typing backport package causes autodoc errors with python 2.7
1 parent 0286c68 commit 20b3da5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Bugs fixed
5757
* #2555: Fix crash on any-references with unicode.
5858
* #2517: wrong bookmark encoding in PDF if using LuaLaTeX
5959
* #2521: generated Makefile causes BSD make crashed if sphinx-build not found
60+
* #2470: ``typing`` backport package causes autodoc errors with python 2.7
6061

6162

6263
Release 1.4.1 (released Apr 12, 2016)

sphinx/ext/autodoc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
from sphinx.util.docstrings import prepare_docstring
3636

3737
try:
38-
import typing
38+
if sys.version_info >= (3,):
39+
import typing
40+
else:
41+
typing = None
3942
except ImportError:
4043
typing = None
4144

0 commit comments

Comments
 (0)