From 60cfab995f6669b87554a70a908241658332ac8c Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sat, 27 Apr 2013 03:56:20 -0700 Subject: Try preventing strptime thread safety problems. Fixes #231 --- sleekxmpp/xmlstream/cert.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sleekxmpp') diff --git a/sleekxmpp/xmlstream/cert.py b/sleekxmpp/xmlstream/cert.py index fa12f794..71146f36 100644 --- a/sleekxmpp/xmlstream/cert.py +++ b/sleekxmpp/xmlstream/cert.py @@ -1,6 +1,10 @@ import logging from datetime import datetime, timedelta +# Make a call to strptime before starting threads to +# prevent thread safety issues. +datetime.strptime('1970-01-01 12:00:00', "%Y-%m-%d %H:%M:%S") + try: from pyasn1.codec.der import decoder, encoder -- cgit v1.2.3