(dirname, basename, dir_fd, dironly, include_hidden=False)
| 109 | return fnmatch.filter(names, pattern) |
| 110 | |
| 111 | def _glob0(dirname, basename, dir_fd, dironly, include_hidden=False): |
| 112 | if basename: |
| 113 | if _lexists(_join(dirname, basename), dir_fd): |
| 114 | return [basename] |
| 115 | else: |
| 116 | # `os.path.split()` returns an empty basename for paths ending with a |
| 117 | # directory separator. 'q*x/' should match only directories. |
| 118 | if _isdir(dirname, dir_fd): |
| 119 | return [basename] |
| 120 | return [] |
| 121 | |
| 122 | # Following functions are not public but can be used by third-party code. |
| 123 |