Message113753
Thanks for the patch.
+ if j < n and pat[j] == '}':
+ j = j+1
I don't get what the purpose of these two lines is. Forbid empty patterns?
+ while i < n and pat[j] != '}':
+ j = j+1
You probably mean "while j < n" instead of "while i < n".
Regardless, it's simpler to use "j = pat.find('}', j)".
You should also add a test for unmatched braces. Currently:
$ ./python -c "import fnmatch; print(fnmatch.translate('{x'))"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/antoine/py3k/__svn__/Lib/fnmatch.py", line 129, in translate
while i < n and pat[j] != '}':
IndexError: string index out of range |
|
Date |
User |
Action |
Args |
2010-08-13 10:23:14 | pitrou | set | recipients:
+ pitrou, bochecha |
2010-08-13 10:23:14 | pitrou | set | messageid: <1281694994.12.0.755084274062.issue9584@psf.upfronthosting.co.za> |
2010-08-13 10:23:12 | pitrou | link | issue9584 messages |
2010-08-13 10:23:11 | pitrou | create | |
|