diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-06 12:35:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-09 13:39:13 +0000 |
commit | 6f6f51783af0e45ebda4442e33c9de1a3932263c (patch) | |
tree | c0248477700bc8b46b65f3039edefdcde17d7f97 /bitbake/lib | |
parent | 949c7062b7b4d785e949d483fa46ada824442d53 (diff) | |
download | poky-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.py | 6 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 22 | ||||
-rw-r--r-- | bitbake/lib/prserv/serv.py | 7 |
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 | |||
28 | import warnings | 28 | import warnings |
29 | from bb.compat import total_ordering | 29 | from bb.compat import total_ordering |
30 | from collections import Mapping | 30 | from collections import Mapping |
31 | 31 | import sqlite3 | |
32 | try: | ||
33 | import sqlite3 | ||
34 | except ImportError: | ||
35 | from pysqlite2 import dbapi2 as sqlite3 | ||
36 | 32 | ||
37 | sqlversion = sqlite3.sqlite_version_info | 33 | sqlversion = sqlite3.sqlite_version_info |
38 | if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): | 34 | if 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): | |||
538 | def sha256_file(filename): | 534 | def 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 | |||
5 | import queue | 5 | import queue |
6 | import socket | 6 | import socket |
7 | import io | 7 | import io |
8 | 8 | import sqlite3 | |
9 | try: | ||
10 | import sqlite3 | ||
11 | except ImportError: | ||
12 | from pysqlite2 import dbapi2 as sqlite3 | ||
13 | |||
14 | import bb.server.xmlrpc | 9 | import bb.server.xmlrpc |
15 | import prserv | 10 | import prserv |
16 | import prserv.db | 11 | import prserv.db |