summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-06 12:35:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-09 13:39:13 +0000
commit6f6f51783af0e45ebda4442e33c9de1a3932263c (patch)
treec0248477700bc8b46b65f3039edefdcde17d7f97 /bitbake/lib
parent949c7062b7b4d785e949d483fa46ada824442d53 (diff)
downloadpoky-6f6f51783af0e45ebda4442e33c9de1a3932263c.tar.gz
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>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/persist_data.py6
-rw-r--r--bitbake/lib/bb/utils.py22
-rw-r--r--bitbake/lib/prserv/serv.py7
3 files changed, 7 insertions, 28 deletions
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py
index e6bbff88ea..bef7018614 100644
--- a/bitbake/lib/bb/persist_data.py
+++ b/bitbake/lib/bb/persist_data.py
@@ -28,11 +28,7 @@ import sys
28import warnings 28import warnings
29from bb.compat import total_ordering 29from bb.compat import total_ordering
30from collections import Mapping 30from collections import Mapping
31 31import sqlite3
32try:
33 import sqlite3
34except ImportError:
35 from pysqlite2 import dbapi2 as sqlite3
36 32
37sqlversion = sqlite3.sqlite_version_info 33sqlversion = sqlite3.sqlite_version_info
38if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): 34if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index a22a05e241..2845126293 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -523,12 +523,8 @@ def md5_file(filename):
523 """ 523 """
524 Return the hex string representation of the MD5 checksum of filename. 524 Return the hex string representation of the MD5 checksum of filename.
525 """ 525 """
526 try: 526 import hashlib
527 import hashlib 527 m = hashlib.md5()
528 m = hashlib.md5()
529 except ImportError:
530 import md5
531 m = md5.new()
532 528
533 with open(filename, "rb") as f: 529 with open(filename, "rb") as f:
534 for line in f: 530 for line in f:
@@ -538,14 +534,9 @@ def md5_file(filename):
538def sha256_file(filename): 534def sha256_file(filename):
539 """ 535 """
540 Return the hex string representation of the 256-bit SHA checksum of 536 Return the hex string representation of the 256-bit SHA checksum of
541 filename. On Python 2.4 this will return None, so callers will need to 537 filename.
542 handle that by either skipping SHA checks, or running a standalone sha256sum
543 binary.
544 """ 538 """
545 try: 539 import hashlib
546 import hashlib
547 except ImportError:
548 return None
549 540
550 s = hashlib.sha256() 541 s = hashlib.sha256()
551 with open(filename, "rb") as f: 542 with open(filename, "rb") as f:
@@ -557,10 +548,7 @@ def sha1_file(filename):
557 """ 548 """
558 Return the hex string representation of the SHA1 checksum of the filename 549 Return the hex string representation of the SHA1 checksum of the filename
559 """ 550 """
560 try: 551 import hashlib
561 import hashlib
562 except ImportError:
563 return None
564 552
565 s = hashlib.sha1() 553 s = hashlib.sha1()
566 with open(filename, "rb") as f: 554 with open(filename, "rb") as f:
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index d9b602f14c..a7efa58bc7 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -5,12 +5,7 @@ import threading
5import queue 5import queue
6import socket 6import socket
7import io 7import io
8 8import sqlite3
9try:
10 import sqlite3
11except ImportError:
12 from pysqlite2 import dbapi2 as sqlite3
13
14import bb.server.xmlrpc 9import bb.server.xmlrpc
15import prserv 10import prserv
16import prserv.db 11import prserv.db