Skip to content

Commit

Permalink
Fixes unclosed file
Browse files Browse the repository at this point in the history
  • Loading branch information
AngellusMortis committed Jul 1, 2023
1 parent a621a66 commit 796b528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guarddog/analyzer/metadata/pypi/typosquatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def _get_top_packages(self) -> list:
update_time = datetime.fromtimestamp(os.path.getmtime(top_packages_path))

if datetime.now() - update_time <= timedelta(days=30):
top_packages_file = open(top_packages_path, "r")
top_packages_information = json.load(top_packages_file)["rows"]
with open(top_packages_path, "r") as top_packages_file:
top_packages_information = json.load(top_packages_file)["rows"]

if top_packages_information is None:
response = requests.get(popular_packages_url).json()
Expand Down

0 comments on commit 796b528

Please sign in to comment.