Skip to content

Commit 89918bf

Browse files
committed
0.3.4: Set default of version to current. Closes #5
1 parent 1d7aaa6 commit 89918bf

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

stdlib_list/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.3"
1+
__version__ = "0.3.4"

stdlib_list/base.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
from __future__ import print_function, absolute_import
22

3-
from . import get_canonical_version, list_dir
4-
53
import os
4+
import sys
5+
6+
from . import get_canonical_version, list_dir
67

78

8-
def stdlib_list(version):
9+
def stdlib_list(version=None):
910
"""
1011
Given a ``version``, return a ``list`` of names of the Python Standard
1112
Libraries for that version. These names are obtained from the Sphinx inventory
1213
file (used in :py:mod:`sphinx.ext.intersphinx`).
1314
14-
:param str version: The version (as a string) whose list of libraries you want
15-
(one of ``"2.6"``, ``"2.7"``, ``"3.2"``, ``"3.3"``, ``"3.4"``, or ``"3.5"``)
15+
:param str|None version: The version (as a string) whose list of libraries you want
16+
(one of ``"2.6"``, ``"2.7"``, ``"3.2"``, ``"3.3"``, ``"3.4"``, or ``"3.5"``).
17+
If not specified, the current version of Python will be used.
1618
1719
:return: A list of standard libraries from the specified version of Python
1820
:rtype: list
1921
"""
2022

21-
version = get_canonical_version(version)
23+
version = get_canonical_version(version) if version is not None else '.'.join(
24+
str(x) for x in sys.version_info[:2])
2225

2326
module_list_file = os.path.join(list_dir, "{}.txt".format(version))
2427

0 commit comments

Comments
 (0)