Skip to content

Commit

Permalink
use with open() so the file actually gets closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvl4Sword authored Nov 17, 2023
1 parent 5e23993 commit 03d94d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/cyberPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def listWebsitesJson(self):

websites = Websites.objects.all()
ipFile = "/etc/cyberpanel/machineIP"
f = open(ipFile)
ipData = f.read()
with open(ipFile, 'r') as f:
ipData = f.read()
ipAddress = ipData.split('\n', 1)[0]

json_data = []
Expand Down

0 comments on commit 03d94d7

Please sign in to comment.