summaryrefslogtreecommitdiffstats
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-03-07 11:04:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-03-07 11:04:33 (GMT)
commit05c075d629fc81035b438e3b146872dc7799f260 (patch)
tree4240955ee3ea5894d0c068c9669244a7200e768c /Lib/ntpath.py
parentf08c073ded5a7cf5786f9a561e3d9529def81b6e (diff)
downloadcpython-05c075d629fc81035b438e3b146872dc7799f260.zip
cpython-05c075d629fc81035b438e3b146872dc7799f260.tar.gz
cpython-05c075d629fc81035b438e3b146872dc7799f260.tar.bz2
Bug #1115886: os.path.splitext('.cshrc') gives now ('.cshrc', '').
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 23d5127..2ea3358 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -8,6 +8,7 @@ module as os.path.
import os
import stat
import sys
+import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
@@ -182,16 +183,8 @@ def split(p):
# It is always true that root + ext == p.
def splitext(p):
- """Split the extension from a pathname.
-
- Extension is everything from the last dot to the end.
- Return (root, ext), either part may be empty."""
-
- i = p.rfind('.')
- if i<=max(p.rfind('/'), p.rfind('\\')):
- return p, ''
- else:
- return p[:i], p[i:]
+ return genericpath._splitext(p, sep, altsep, extsep)
+splitext.__doc__ = genericpath._splitext.__doc__
# Return the tail (basename) part of a path.