Skip to content

Commit d14eb75

Browse files
mahdirahimi1999Mahdi
and
Mahdi
authored
Refactor read function to use context manager for file handling (#8967)
Co-authored-by: Mahdi <[email protected]>
1 parent f1a11d4 commit d14eb75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737

3838

3939
def read(f):
40-
return open(f, 'r', encoding='utf-8').read()
40+
with open(f, 'r', encoding='utf-8') as file:
41+
return file.read()
4142

4243

4344
def get_version(package):

0 commit comments

Comments
 (0)