Minor typing fix
This commit is contained in:
1 parent
eab58cd5f2
commit
6626f94015
1 file changed
+5
-2
@@ -16,7 +16,7 @@ if __name__ == "__main__":
|
|||||||
import traceback
|
import traceback
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import messagebox
|
from tkinter import messagebox
|
||||||
from typing import IO, NoReturn
|
from typing import NoReturn, TYPE_CHECKING
|
||||||
|
|
||||||
import truststore
|
import truststore
|
||||||
truststore.inject_into_ssl()
|
truststore.inject_into_ssl()
|
||||||
@@ -29,6 +29,9 @@ if __name__ == "__main__":
|
|||||||
from utils import lock_file, resource_path, set_root_icon
|
from utils import lock_file, resource_path, set_root_icon
|
||||||
from constants import LOGGING_LEVELS, SELF_PATH, FILE_FORMATTER, LOG_PATH, LOCK_PATH
|
from constants import LOGGING_LEVELS, SELF_PATH, FILE_FORMATTER, LOG_PATH, LOCK_PATH
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from _typeshed import SupportsWrite
|
||||||
|
|
||||||
warnings.simplefilter("default", ResourceWarning)
|
warnings.simplefilter("default", ResourceWarning)
|
||||||
|
|
||||||
if sys.version_info < (3, 10):
|
if sys.version_info < (3, 10):
|
||||||
@@ -39,7 +42,7 @@ if __name__ == "__main__":
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self._message: io.StringIO = io.StringIO()
|
self._message: io.StringIO = io.StringIO()
|
||||||
|
|
||||||
def _print_message(self, message: str, file: IO[str] | None = None) -> None:
|
def _print_message(self, message: str, file: SupportsWrite[str] | None = None) -> None:
|
||||||
self._message.write(message)
|
self._message.write(message)
|
||||||
# print(message, file=self._message)
|
# print(message, file=self._message)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user