| 139 | return fnmatch.filter(names, pattern) |
| 140 | |
| 141 | def _glob0(dirname, basename, dir_fd, dironly, include_hidden=False): |
| 142 | if basename: |
| 143 | if _lexists(_join(dirname, basename), dir_fd): |
| 144 | return [basename] |
| 145 | else: |
| 146 | # `os.path.split()` returns an empty basename for paths ending with a |
| 147 | # directory separator. 'q*x/' should match only directories. |
| 148 | if _isdir(dirname, dir_fd): |
| 149 | return [basename] |
| 150 | return [] |
| 151 | |
| 152 | # This helper function recursively yields relative pathnames inside a literal |
| 153 | # directory. |