File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,9 @@ def update_version_in_files(
154
154
regex = regexes [0 ] if regexes else None
155
155
current_version_found = False
156
156
157
- version_file = open (filepath , "r" ).read ()
157
+ with open (filepath , "r" ) as f :
158
+ version_file = f .read ()
159
+
158
160
match = regex and re .search (regex , version_file , re .MULTILINE )
159
161
if match :
160
162
left = version_file [: match .end ()]
@@ -167,7 +169,7 @@ def update_version_in_files(
167
169
168
170
if not regex :
169
171
current_version_regex = _version_to_regex (current_version )
170
- current_version_found = current_version_regex .search (version_file ) and True
172
+ current_version_found = bool ( current_version_regex .search (version_file ))
171
173
version_file = current_version_regex .sub (new_version , version_file )
172
174
173
175
if check_consistency and not current_version_found :
You can’t perform that action at this time.
0 commit comments