Skip to content

Commit

Permalink
Remove mode paramter
Browse files Browse the repository at this point in the history
The mode parameter of the open function defaults to 'r', open for reading, so does not need to be specified.
  • Loading branch information
j-t-1 authored Nov 27, 2024
1 parent 4b3b1e2 commit a76798b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _read_doc():
Parse docstring from file 'pefile.py' and avoid importing
this module directly.
"""
with open("pefile.py", "r", encoding="utf-8") as f:
with open("pefile.py", encoding="utf-8") as f:
tree = ast.parse(f.read())
return ast.get_docstring(tree)

Expand All @@ -31,7 +31,7 @@ def _read_attr(attr_name):
__version__, __author__, __contact__,
"""
regex = attr_name + r"\s+=\s+['\"](.+)['\"]"
with open("pefile.py", "r", encoding="utf-8") as f:
with open("pefile.py", encoding="utf-8") as f:
match = re.search(regex, f.read())
# Second item in the group is the value of attribute.
return match.group(1)
Expand Down

0 comments on commit a76798b

Please sign in to comment.