Skip to content

Commit

Permalink
Removed unused mypy ignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Jan 12, 2024
1 parent 46a115f commit 15c3c59
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/twisted/internet/test/process_gireactornocompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
sys.exit(0)

try:
import gobject # type: ignore[import-not-found]
import gobject
except ImportError:
sys.stdout.write("success")
else:
Expand Down
4 changes: 2 additions & 2 deletions src/twisted/internet/test/process_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def grandchild() -> None:
def main() -> None:
if sys.argv[1] == "child":
if sys.argv[2] == "windows":
import win32api as api # type: ignore[import-untyped]
import win32process as proc # type: ignore[import-not-found]
import win32api as api
import win32process as proc

info = proc.STARTUPINFO()
info.hStdInput = api.GetStdHandle(api.STD_INPUT_HANDLE)
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/logger/_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Log levels.
"""

from constantly import NamedConstant, Names # type: ignore[import-untyped]
from constantly import NamedConstant, Names


class InvalidLogLevelError(Exception):
Expand Down
9 changes: 1 addition & 8 deletions src/twisted/python/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@


# Import and re-export Constantly
from constantly import ( # type: ignore[import-untyped]
FlagConstant,
Flags,
NamedConstant,
Names,
ValueConstant,
Values,
)
from constantly import FlagConstant, Flags, NamedConstant, Names, ValueConstant, Values

__all__ = ["NamedConstant", "ValueConstant", "FlagConstant", "Names", "Values", "Flags"]
4 changes: 2 additions & 2 deletions src/twisted/python/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def unique():
# race-conditions duty. - hawkie

try:
import pywintypes # type: ignore[import-untyped]
from win32api import OpenProcess # type: ignore[import-untyped]
import pywintypes
from win32api import OpenProcess
except ImportError:
kill = None # type: ignore[assignment]
else:
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/python/shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os

import pythoncom # type: ignore[import-untyped]
from win32com.shell import shell # type: ignore[import-untyped]
from win32com.shell import shell


def open(filename):
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/python/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def fromEnvironment(cls):
except ImportError:
WinError = None
try:
from win32api import FormatMessage # type: ignore[import-untyped]
from win32api import FormatMessage
except ImportError:
FormatMessage = None
try:
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/test/mock_win32process.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CreateProcess(...) will spawn a process, and always return a PID of 42.
"""

import win32process # type: ignore[import-not-found]
import win32process

GetExitCodeProcess = win32process.GetExitCodeProcess
STARTUPINFO = win32process.STARTUPINFO
Expand Down

0 comments on commit 15c3c59

Please sign in to comment.