diff options
| author | Martin v. Löwis <martin@v.loewis.de> | 2007-03-07 11:04:33 (GMT) | 
|---|---|---|
| committer | Martin v. Löwis <martin@v.loewis.de> | 2007-03-07 11:04:33 (GMT) | 
| commit | 05c075d629fc81035b438e3b146872dc7799f260 (patch) | |
| tree | 4240955ee3ea5894d0c068c9669244a7200e768c /Lib/macpath.py | |
| parent | f08c073ded5a7cf5786f9a561e3d9529def81b6e (diff) | |
| download | cpython-05c075d629fc81035b438e3b146872dc7799f260.zip cpython-05c075d629fc81035b438e3b146872dc7799f260.tar.gz cpython-05c075d629fc81035b438e3b146872dc7799f260.tar.bz2  | |
Bug #1115886: os.path.splitext('.cshrc') gives now ('.cshrc', '').
Diffstat (limited to 'Lib/macpath.py')
| -rw-r--r-- | Lib/macpath.py | 14 | 
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py index d389d70..f54ffa0 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -2,6 +2,7 @@  import os  from stat import * +import genericpath  from genericpath import *  __all__ = ["normcase","isabs","join","splitdrive","split","splitext", @@ -69,17 +70,8 @@ def split(s):  def splitext(p): -    """Split a path into root and extension. -    The extension is everything starting at the last dot in the last -    pathname component; the root is everything before that. -    It is always true that root + ext == p.""" - -    i = p.rfind('.') -    if i<=p.rfind(':'): -        return p, '' -    else: -        return p[:i], p[i:] - +    return genericpath._splitext(p, sep, altsep, extsep) +splitext.__doc__ = genericpath._splitext.__doc__  def splitdrive(p):      """Split a pathname into a drive specification and the rest of the  | 
