summaryrefslogtreecommitdiff
path: root/sphinx/project.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-01 20:43:59 +0000
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-01 20:48:39 +0000
commit14a9289d780240bbce78ad3640e8e1b1b12df43f (patch)
treefd753f5b0f8c7053923b78c8fef2b90b60f9c7fa /sphinx/project.py
parent26f79b0d2dd88b353ac65623897bdfbe8bc07cab (diff)
downloadsphinx-git-14a9289d780240bbce78ad3640e8e1b1b12df43f.tar.gz
Use PEP 604 types
Diffstat (limited to 'sphinx/project.py')
-rw-r--r--sphinx/project.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/project.py b/sphinx/project.py
index d993ec504..89e003b22 100644
--- a/sphinx/project.py
+++ b/sphinx/project.py
@@ -4,7 +4,7 @@ from __future__ import annotations
import os
from glob import glob
-from typing import Iterable, Optional
+from typing import Iterable
from sphinx.locale import __
from sphinx.util import logging
@@ -58,7 +58,7 @@ class Project:
return self.docnames
- def path2doc(self, filename: str) -> Optional[str]:
+ def path2doc(self, filename: str) -> str | None:
"""Return the docname for the filename if the file is a document.
*filename* should be absolute or relative to the source directory.