File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def _get_libgit2_path():
48
48
49
49
# Default
50
50
if os .name == 'nt' :
51
- return Path (r'%s\libgit2' % os .getenv ('ProgramFiles' ))
51
+ return Path (r'%s\libgit2' % os .getenv ('ProgramFiles' )) # noqa: SIM112
52
52
return Path ('/usr/local' )
53
53
54
54
Original file line number Diff line number Diff line change 45
45
# C_HEADER_SRC
46
46
if getattr (sys , 'frozen' , False ):
47
47
if hasattr (sys , '_MEIPASS' ):
48
- dir_path = Path (sys ._MEIPASS )
48
+ dir_path = Path (sys ._MEIPASS ) # type: ignore
49
49
else :
50
50
dir_path = Path (sys .executable ).parent
51
51
else :
83
83
'submodule.h' ,
84
84
'callbacks.h' , # Bridge from libgit2 to Python
85
85
]
86
- h_source = []
86
+ h_source : list [ str ] = []
87
87
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 :
90
90
h_source .append (f .read ())
91
91
92
92
C_HEADER_SRC = '\n ' .join (h_source )
99
99
# ffi
100
100
_ , libgit2_kw = get_libgit2_paths ()
101
101
ffi = FFI ()
102
- ffi .set_source ('pygit2._libgit2' , C_PREAMBLE , ** libgit2_kw )
102
+ ffi .set_source ('pygit2._libgit2' , C_PREAMBLE , ** libgit2_kw ) # type: ignore
103
103
ffi .cdef (C_HEADER_SRC )
104
104
105
105
You can’t perform that action at this time.
0 commit comments