More accurate (and possibly more efficient) version of the _requires_normalization regex

parent 4a5b5409
...@@ -14,9 +14,7 @@ import re ...@@ -14,9 +14,7 @@ import re
import os import os
#_requires_normalization = re.compile(r'/\.\.|\./|\.|//').search _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
def normpath(path): def normpath(path):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment