[gnome-continuous-yocto/gnomeostree-3.28-rocko: 3965/8267] bitbake: prserv/persist_data/utils: Drop obsolete python2 imports
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 3965/8267] bitbake: prserv/persist_data/utils: Drop obsolete python2 imports
- Date: Sun, 17 Dec 2017 01:22:23 +0000 (UTC)
commit 6f6f51783af0e45ebda4442e33c9de1a3932263c
Author: Richard Purdie <richard purdie linuxfoundation org>
Date: Fri Jan 6 12:35:08 2017 +0000
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>
bitbake/lib/bb/persist_data.py | 6 +-----
bitbake/lib/bb/utils.py | 22 +++++-----------------
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 e6bbff8..bef7018 100644
--- a/bitbake/lib/bb/persist_data.py
+++ b/bitbake/lib/bb/persist_data.py
@@ -28,11 +28,7 @@ import sys
import warnings
from bb.compat import total_ordering
from collections import Mapping
-
-try:
- import sqlite3
-except ImportError:
- from pysqlite2 import dbapi2 as sqlite3
+import sqlite3
sqlversion = sqlite3.sqlite_version_info
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 a22a05e..2845126 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -523,12 +523,8 @@ def md5_file(filename):
"""
Return the hex string representation of the MD5 checksum of filename.
"""
- try:
- import hashlib
- m = hashlib.md5()
- except ImportError:
- import md5
- m = md5.new()
+ import hashlib
+ m = hashlib.md5()
with open(filename, "rb") as f:
for line in f:
@@ -538,14 +534,9 @@ def md5_file(filename):
def sha256_file(filename):
"""
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
- handle that by either skipping SHA checks, or running a standalone sha256sum
- binary.
+ filename.
"""
- try:
- import hashlib
- except ImportError:
- return None
+ import hashlib
s = hashlib.sha256()
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
"""
- try:
- import hashlib
- except ImportError:
- return None
+ import hashlib
s = hashlib.sha1()
with open(filename, "rb") as f:
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index d9b602f..a7efa58 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -5,12 +5,7 @@ import threading
import queue
import socket
import io
-
-try:
- import sqlite3
-except ImportError:
- from pysqlite2 import dbapi2 as sqlite3
-
+import sqlite3
import bb.server.xmlrpc
import prserv
import prserv.db
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]