mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
updater: remove magic number
Remove the magic number, a whence value of 2 for file.seek(), and instead use the io.SEEK_END constant from the io module. Signed-off-by: Joshua Lock <jlock@vmware.com>
This commit is contained in:
parent
16bd3c2358
commit
8ee8e862af
1 changed files with 2 additions and 3 deletions
|
|
@ -128,6 +128,7 @@
|
|||
import fnmatch
|
||||
import copy
|
||||
import warnings
|
||||
import io
|
||||
|
||||
import tuf
|
||||
import tuf.download
|
||||
|
|
@ -1245,9 +1246,7 @@ def _check_file_length(self, file_object, trusted_file_length):
|
|||
None.
|
||||
"""
|
||||
|
||||
# seek to the end of the file; that is offset 0 from the end of the file,
|
||||
# represented by a whence value of 2
|
||||
file_object.seek(0, 2)
|
||||
file_object.seek(0, io.SEEK_END)
|
||||
observed_length = file_object.tell()
|
||||
|
||||
# Return and log a message if the length 'file_object' is equal to
|
||||
|
|
|
|||
Loading…
Reference in a new issue