|
5 | 5 | import codecs |
6 | 6 | import pickle |
7 | 7 | import time |
| 8 | +from fnmatch import fnmatch |
8 | 9 | from os import path |
9 | 10 | from typing import TYPE_CHECKING, Any |
10 | | -from fnmatch import fnmatch |
11 | 11 |
|
12 | 12 | from docutils import nodes |
13 | 13 | from docutils.utils import DependencyList |
@@ -423,14 +423,14 @@ def read(self) -> list[str]: |
423 | 423 | if self.config.root_doc not in self.env.all_docs: |
424 | 424 | root_doc_path = self.env.doc2path(self.config.root_doc) |
425 | 425 | if ("**" in self.config.exclude_patterns or |
426 | | - any(fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat) |
| 426 | + any(fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat) |
427 | 427 | for pat in self.config.exclude_patterns)): |
428 | 428 | raise SphinxError('customized exclude_patterns is set ' + |
429 | 429 | 'and root file %s is in the exclude_patterns' % |
430 | 430 | root_doc_path) |
431 | | - elif ("**" not in self.config.include_patterns and |
432 | | - not any((fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat)) |
433 | | - for pat in self.config.include_patterns)): |
| 431 | + elif ("**" not in self.config.include_patterns and |
| 432 | + not any((fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat)) |
| 433 | + for pat in self.config.include_patterns)): |
434 | 434 | raise SphinxError('customized include_patterns is set, ' + |
435 | 435 | 'but root file %s is not in the include_patterns' % |
436 | 436 | root_doc_path) |
|
0 commit comments