Test whether FILENAME matches PATTERN. Patterns are Unix shell style: * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq An initial period in FILENAME is not special. Both FILENAME an
(name, pat)
| 20 | |
| 21 | |
| 22 | def fnmatch(name, pat): |
| 23 | """Test whether FILENAME matches PATTERN. |
| 24 | |
| 25 | Patterns are Unix shell style: |
| 26 | |
| 27 | * matches everything |
| 28 | ? matches any single character |
| 29 | [seq] matches any character in seq |
| 30 | [!seq] matches any char not in seq |
| 31 | |
| 32 | An initial period in FILENAME is not special. |
| 33 | Both FILENAME and PATTERN are first case-normalized |
| 34 | if the operating system requires it. |
| 35 | If you don't want this, use fnmatchcase(FILENAME, PATTERN). |
| 36 | """ |
| 37 | name = os.path.normcase(name) |
| 38 | pat = os.path.normcase(pat) |
| 39 | return fnmatchcase(name, pat) |
| 40 | |
| 41 | |
| 42 | @functools.lru_cache(maxsize=32768, typed=True) |
searching dependent graphs…