Update worker.py
This commit is contained in:
1 parent
bbb17c47c2
commit
76e1cd0f4b
1 file changed
+5
-5
+5
-5
@@ -18,11 +18,11 @@ filename = firstline.split('/')[-1].split('#')[0].split('?')[0]
|
||||
urllib.request.urlretrieve(firstline, filename)
|
||||
|
||||
# Get the magic bytes
|
||||
f = open(filename)
|
||||
f.seek(8)
|
||||
data = f.read(3)
|
||||
for c in data:
|
||||
print(c) # FIXME; should be 0x414902
|
||||
with open(filename) as f: # <zyga-suse> this always closes f, even if exceptions happen
|
||||
f.seek(8)
|
||||
data = f.read(3)
|
||||
for c in data:
|
||||
print(c) # FIXME; should be 0x414902
|
||||
|
||||
# Exit if the magic bytes are not 0x414901 (type 1) or 0x414902 (type 2)
|
||||
|
||||
|
||||
Reference in new issue
Block a user