summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1994-12-14 15:29:17 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1994-12-14 15:29:17 (GMT)
commit43598605179f6ac4640e5f074cab97d4cd54b488 (patch)
treef58a329a69b5a218a6224628853a26f5fb6a495b /Lib
parent1cfb6b8992393626a21325aa6d9b708684f770ac (diff)
downloadcpython-43598605179f6ac4640e5f074cab97d4cd54b488.zip
cpython-43598605179f6ac4640e5f074cab97d4cd54b488.tar.gz
cpython-43598605179f6ac4640e5f074cab97d4cd54b488.tar.bz2
Let extensions start at the last period after the last slash in the
name.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/posixpath.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 6110f8e..73e380c 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -62,7 +62,12 @@ def splitext(p):
for c in p:
if c == '/':
root, ext = root + ext + c, ''
- elif c == '.' or ext:
+ elif c == '.':
+ if ext:
+ root, ext = root + ext, c
+ else:
+ ext = c
+ elif ext:
ext = ext + c
else:
root = root + c