summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-06-08 08:29:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-06-08 08:29:33 (GMT)
commitbdec50f0277971830e307aff8090c1494a69f4ce (patch)
tree19ae2f89e1b093efd1062a997d9139c781b9d9a9 /Lib/os.py
parentf30d60edbc0d5047a2fdd01e25868e4b814107e2 (diff)
downloadcpython-bdec50f0277971830e307aff8090c1494a69f4ce.zip
cpython-bdec50f0277971830e307aff8090c1494a69f4ce.tar.gz
cpython-bdec50f0277971830e307aff8090c1494a69f4ce.tar.bz2
Feature request #935915: Add os.path.devnull.
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index c037ea9..5b79981 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -12,6 +12,7 @@ This exports:
- os.pathsep is the component separator used in $PATH etc
- os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
- os.defpath is the default search path for executables
+ - os.devnull is the file path of the null device ('/dev/null', etc.)
Programs that import and use 'os' stand a better chance of being
portable between different platforms. Of course, they must then
@@ -28,7 +29,7 @@ _names = sys.builtin_module_names
# Note: more names are added to __all__ later.
__all__ = ["altsep", "curdir", "pardir", "sep", "pathsep", "linesep",
- "defpath", "name", "path"]
+ "defpath", "name", "path", "devnull"]
def _get_exports_list(module):
try:
@@ -129,7 +130,8 @@ else:
raise ImportError, 'no os specific module found'
sys.modules['os.path'] = path
-from os.path import curdir, pardir, sep, pathsep, defpath, extsep, altsep
+from os.path import curdir, pardir, sep, pathsep, defpath, extsep, altsep, \
+ devnull
del _names