Skip to content

Commit c3b01f8

Browse files
committed
fix typing for _build.py and _run.py
1 parent 35fb5e1 commit c3b01f8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pygit2/_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _get_libgit2_path():
4848

4949
# Default
5050
if os.name == 'nt':
51-
return Path(r'%s\libgit2' % os.getenv('ProgramFiles'))
51+
return Path(r'%s\libgit2' % os.getenv('ProgramFiles')) # noqa: SIM112
5252
return Path('/usr/local')
5353

5454

pygit2/_run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# C_HEADER_SRC
4646
if getattr(sys, 'frozen', False):
4747
if hasattr(sys, '_MEIPASS'):
48-
dir_path = Path(sys._MEIPASS)
48+
dir_path = Path(sys._MEIPASS) # type: ignore
4949
else:
5050
dir_path = Path(sys.executable).parent
5151
else:
@@ -83,10 +83,10 @@
8383
'submodule.h',
8484
'callbacks.h', # Bridge from libgit2 to Python
8585
]
86-
h_source = []
86+
h_source: list[str] = []
8787
for h_file in h_files:
88-
h_file = dir_path / 'decl' / h_file
89-
with codecs.open(h_file, 'r', 'utf-8') as f:
88+
h_file = dir_path / 'decl' / h_file # noqa: PLW2901
89+
with codecs.open(str(h_file), 'r', 'utf-8') as f:
9090
h_source.append(f.read())
9191

9292
C_HEADER_SRC = '\n'.join(h_source)
@@ -99,7 +99,7 @@
9999
# ffi
100100
_, libgit2_kw = get_libgit2_paths()
101101
ffi = FFI()
102-
ffi.set_source('pygit2._libgit2', C_PREAMBLE, **libgit2_kw)
102+
ffi.set_source('pygit2._libgit2', C_PREAMBLE, **libgit2_kw) # type: ignore
103103
ffi.cdef(C_HEADER_SRC)
104104

105105

0 commit comments

Comments
 (0)