Fix errors in folded_script_name.
Got both the regex wrong and the order of arguments wrong, sheesh.
@@ -378,12 +378,12 @@ def defined_characters(version=None, scr=None):
return characters
-_strip_re = re.compile(r"['-_ ]+")
+_strip_re = re.compile(r"[-'_ ]+")
def _folded_script_name(script_name):
"""Folds a script name to its bare bones for comparison."""
# string.translate is changed by codecs, the method no longer takes two
# parameters and so script_name.translate(None, "'-_ ") fails to compile
- return _strip_re.sub(script_name, '')
+ return _strip_re.sub('', script_name)
def script_code(script_name):
