mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Use context manager for file reading
This commit is contained in:
parent
52aa88f08a
commit
d82ca0aed5
1 changed files with 3 additions and 1 deletions
4
setup.py
4
setup.py
|
|
@ -10,7 +10,9 @@ import analytical as package
|
|||
|
||||
|
||||
def read_file(fname):
|
||||
return (Path(__file__).resolve().parent / fname).open().read()
|
||||
"""Read content of a file in project folder."""
|
||||
with (Path(__file__).resolve().parent / fname).open() as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
setup(
|
||||
|
|
|
|||
Loading…
Reference in a new issue