Skip to content

Commit

Permalink
Merge pull request #260 from AngellusMortis/fix-file
Browse files Browse the repository at this point in the history
Fixes unclosed file
  • Loading branch information
christophetd authored Jul 3, 2023
2 parents a621a66 + 796b528 commit c2b5536
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 c2b5536

Please sign in to comment.