bitbake: prserv/persist_data/utils: Drop obsolete python2 imports
These imports were from python 2.6 and earlier, 2.4 in some cases. Drop them since we're all python3 now. (Bitbake rev: 7ef12684e8647b006bf46cae695069d4bfece1cf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
949c7062b7
commit
6f6f51783a
|
@ -28,11 +28,7 @@ import sys
|
||||||
import warnings
|
import warnings
|
||||||
from bb.compat import total_ordering
|
from bb.compat import total_ordering
|
||||||
from collections import Mapping
|
from collections import Mapping
|
||||||
|
import sqlite3
|
||||||
try:
|
|
||||||
import sqlite3
|
|
||||||
except ImportError:
|
|
||||||
from pysqlite2 import dbapi2 as sqlite3
|
|
||||||
|
|
||||||
sqlversion = sqlite3.sqlite_version_info
|
sqlversion = sqlite3.sqlite_version_info
|
||||||
if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
|
if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
|
||||||
|
|
|
@ -523,12 +523,8 @@ def md5_file(filename):
|
||||||
"""
|
"""
|
||||||
Return the hex string representation of the MD5 checksum of filename.
|
Return the hex string representation of the MD5 checksum of filename.
|
||||||
"""
|
"""
|
||||||
try:
|
import hashlib
|
||||||
import hashlib
|
m = hashlib.md5()
|
||||||
m = hashlib.md5()
|
|
||||||
except ImportError:
|
|
||||||
import md5
|
|
||||||
m = md5.new()
|
|
||||||
|
|
||||||
with open(filename, "rb") as f:
|
with open(filename, "rb") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
|
@ -538,14 +534,9 @@ def md5_file(filename):
|
||||||
def sha256_file(filename):
|
def sha256_file(filename):
|
||||||
"""
|
"""
|
||||||
Return the hex string representation of the 256-bit SHA checksum of
|
Return the hex string representation of the 256-bit SHA checksum of
|
||||||
filename. On Python 2.4 this will return None, so callers will need to
|
filename.
|
||||||
handle that by either skipping SHA checks, or running a standalone sha256sum
|
|
||||||
binary.
|
|
||||||
"""
|
"""
|
||||||
try:
|
import hashlib
|
||||||
import hashlib
|
|
||||||
except ImportError:
|
|
||||||
return None
|
|
||||||
|
|
||||||
s = hashlib.sha256()
|
s = hashlib.sha256()
|
||||||
with open(filename, "rb") as f:
|
with open(filename, "rb") as f:
|
||||||
|
@ -557,10 +548,7 @@ def sha1_file(filename):
|
||||||
"""
|
"""
|
||||||
Return the hex string representation of the SHA1 checksum of the filename
|
Return the hex string representation of the SHA1 checksum of the filename
|
||||||
"""
|
"""
|
||||||
try:
|
import hashlib
|
||||||
import hashlib
|
|
||||||
except ImportError:
|
|
||||||
return None
|
|
||||||
|
|
||||||
s = hashlib.sha1()
|
s = hashlib.sha1()
|
||||||
with open(filename, "rb") as f:
|
with open(filename, "rb") as f:
|
||||||
|
|
|
@ -5,12 +5,7 @@ import threading
|
||||||
import queue
|
import queue
|
||||||
import socket
|
import socket
|
||||||
import io
|
import io
|
||||||
|
import sqlite3
|
||||||
try:
|
|
||||||
import sqlite3
|
|
||||||
except ImportError:
|
|
||||||
from pysqlite2 import dbapi2 as sqlite3
|
|
||||||
|
|
||||||
import bb.server.xmlrpc
|
import bb.server.xmlrpc
|
||||||
import prserv
|
import prserv
|
||||||
import prserv.db
|
import prserv.db
|
||||||
|
|
Loading…
Reference in New Issue