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):
"""
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:
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:
"""
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: