1
0
Fork 0

Fix logs in commands.read_file

Print the name of the file being read instead
of its descriptor.
This commit is contained in:
Pavol Žáčik 2024-04-11 10:09:05 +02:00
parent 1fb7c803b6
commit 1f5f9fa59c
No known key found for this signature in database
GPG key ID: B99527D5E6487A92

View file

@ -124,9 +124,9 @@ class commands:
def read_file(self, f, err_ret = "", no_error = False):
old_value = err_ret
try:
f = open(f, "r")
old_value = f.read()
f.close()
fd = open(f, "r")
old_value = fd.read()
fd.close()
except (OSError,IOError) as e:
if not no_error:
self._error("Error when reading file '%s': '%s'" % (f, e))