Skip to content

Commit 54005af

Browse files
committed
Use sys.version_info, not sys.version.
sys.version[0] gives a string, which fails > comparison with 2. Reported by Arne Maximilian Richter on docs@
1 parent 3da5743 commit 54005af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/howto/pyporting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ access e.g. the ``importlib.abc`` module by doing the following::
299299

300300
import sys
301301

302-
if sys.version[0] == 3:
302+
if sys.version_info[0] == 3:
303303
from importlib import abc
304304
else:
305305
from importlib2 import abc
@@ -311,7 +311,7 @@ Python 2::
311311

312312
import sys
313313

314-
if sys.version[0] > 2:
314+
if sys.version_info[0] > 2:
315315
from importlib import abc
316316
else:
317317
from importlib2 import abc

0 commit comments

Comments
 (0)