mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Avoid deprecation warning introduced in Python-2.6.
This commit is contained in:
parent
5755137630
commit
90779b1985
@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import md5
|
HAS_HASHLIB = False
|
||||||
|
try:
|
||||||
|
import hashlib
|
||||||
|
HAS_HASHLIB = True
|
||||||
|
except:
|
||||||
|
import md5
|
||||||
import cgi
|
import cgi
|
||||||
|
|
||||||
print "Content-Type: text/plain\r\n"
|
print "Content-Type: text/plain\r\n"
|
||||||
@ -8,6 +13,9 @@ if form.has_key("file"):
|
|||||||
plik = form["file"]
|
plik = form["file"]
|
||||||
length = 0
|
length = 0
|
||||||
if plik.file:
|
if plik.file:
|
||||||
|
if HAS_HASHLIB:
|
||||||
|
dig = hashlib.md5()
|
||||||
|
else:
|
||||||
dig = md5.new()
|
dig = md5.new()
|
||||||
while 1:
|
while 1:
|
||||||
data = plik.file.read(1000000)
|
data = plik.file.read(1000000)
|
||||||
|
Loading…
Reference in New Issue
Block a user