summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f>2012-12-22 23:43:06 +0000
committergcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f>2012-12-22 23:43:06 +0000
commitbdf95abfb5a2e5102db8bb89d765ef0484b48296 (patch)
tree7cd5c1e1e610cfa033751347c521b1864de6cc24
parent4a5b5409eefc21e1ebfae86371774e1ebfb112fc (diff)
downloadpyfilesystem-git-bdf95abfb5a2e5102db8bb89d765ef0484b48296.tar.gz
More accurate (and possibly more efficient) version of the _requires_normalization regex
-rw-r--r--fs/path.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/path.py b/fs/path.py
index 4378229..806725a 100644
--- a/fs/path.py
+++ b/fs/path.py
@@ -14,9 +14,7 @@ import re
import os
-#_requires_normalization = re.compile(r'/\.\.|\./|\.|//').search
-# New improved re that avoids normalizing paths that don't need it - WM
-_requires_normalization = re.compile(r'/\.\.|\./|^\.$|\.$|//').search
+_requires_normalization = re.compile(r'(^|/)\.\.?($|/)|//').search
def normpath(path):