Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: third_party/tlslite/tlslite/basedb.py

Issue 210323002: Update tlslite to 0.4.6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Executable bit and --similarity=80 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tlslite/tlslite/api.py ('k') | third_party/tlslite/tlslite/checker.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/tlslite/basedb.py
diff --git a/third_party/tlslite/tlslite/basedb.py b/third_party/tlslite/tlslite/basedb.py
index 4988c1501ccec097a7a255d7ef1817041eceebb3..e6b79442f70462eceb4c40b3558281fd27b7ca8e 100644
--- a/third_party/tlslite/tlslite/basedb.py
+++ b/third_party/tlslite/tlslite/basedb.py
@@ -1,9 +1,19 @@
+# Authors:
+# Trevor Perrin
+# Martin von Loewis - python 3 port
+#
+# See the LICENSE file for legal information regarding use of this file.
+
"""Base class for SharedKeyDB and VerifierDB."""
-import anydbm
-import thread
+try:
+ import anydbm
+except ImportError:
+ # Python 3
+ import dbm as anydbm
+import threading
-class BaseDB:
+class BaseDB(object):
def __init__(self, filename, type):
self.type = type
self.filename = filename
@@ -11,7 +21,7 @@ class BaseDB:
self.db = None
else:
self.db = {}
- self.lock = thread.allocate_lock()
+ self.lock = threading.Lock()
def create(self):
"""Create a new on-disk database.
@@ -117,4 +127,4 @@ class BaseDB:
finally:
self.lock.release()
usernames = [u for u in usernames if not u.startswith("--Reserved--")]
- return usernames
+ return usernames
« no previous file with comments | « third_party/tlslite/tlslite/api.py ('k') | third_party/tlslite/tlslite/checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698