Skip to content

Commit e45ad8c

Browse files
committed
Fix mypy issue (unused type: ignore)
1 parent 179c95e commit e45ad8c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/e3/archive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050

5151
class E3ZipInfo(zipfile.ZipInfo):
5252
@classmethod
53-
def from_file(cls, *args, **kwargs): # type: ignore
53+
def from_file(cls, *args, **kwargs):
5454
result = super().from_file(*args, **kwargs)
5555
result.external_attr = (0o555 << 16) | result.external_attr
5656
return result
5757

58-
zipfile.ZipInfo = E3ZipInfo # type: ignore
58+
zipfile.ZipInfo = E3ZipInfo
5959

6060

6161
class E3ZipFile(zipfile.ZipFile):

src/e3/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class MyConfig(ConfigSection):
6969
else:
7070
kwargs[k] = v
7171

72-
return cls(**kwargs) # type: ignore
72+
return cls(**kwargs)
7373

7474

7575
class Config:

src/e3/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def add_log_handlers(
325325
else:
326326
fmt = logging.Formatter(log_format, datefmt)
327327

328-
fmt.converter = time.gmtime # type: ignore
328+
fmt.converter = time.gmtime
329329
handler.setFormatter(fmt)
330330

331331
handler.setLevel(level)

src/e3/os/fs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ def df(path: str, full: bool = False) -> int | tuple:
173173
((1, "path"), (2, "freeuserspace"), (2, "totalspace"), (2, "freespace")),
174174
)
175175

176-
def GetDiskFreeSpaceEx_errcheck(result, func, args): # type: ignore
176+
def GetDiskFreeSpaceEx_errcheck(result, func, args):
177177
del func
178178
if not result: # defensive code
179179
raise ctypes.WinError()
180180
return (args[1].value, args[2].value, args[3].value)
181181

182-
GetDiskFreeSpaceEx.errcheck = GetDiskFreeSpaceEx_errcheck # type: ignore
182+
GetDiskFreeSpaceEx.errcheck = GetDiskFreeSpaceEx_errcheck
183183
_, total, free = GetDiskFreeSpaceEx(c_path)
184184
used = total - free
185185
else: # windows: no cover

src/e3/sys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,15 @@ def is_console() -> bool:
333333
# First check using isatty call. On Windows isatty will return True only
334334
# if in a Win32 console (for example cygwin or msys ptys are not win32
335335
# consoles).
336-
is_tty = os.isatty(stdin_fd) # type: ignore
336+
is_tty = os.isatty(stdin_fd)
337337
if is_tty:
338338
return True
339339

340340
if sys.platform == "win32": # unix: no cover
341341
from msvcrt import get_osfhandle
342342
from e3.os.windows.object import object_name
343343

344-
stdin_name = object_name(get_osfhandle(stdin_fd)) # type: ignore
344+
stdin_name = object_name(get_osfhandle(stdin_fd))
345345
if re.match(r"\\Device\\NamedPipe\\(cygwin|msys).*-pty.*$", stdin_name):
346346
return True
347347
else:

0 commit comments

Comments
 (0)