gentoo-overlay/dev-python/tlslite/files/tlslite-0.3.8-python25.diff

89 lines
2.9 KiB
Diff

--- tlslite/integration/XMLRPCTransport.py
+++ tlslite/integration/XMLRPCTransport.py
@@ -15,7 +15,8 @@
cryptoID=None, protocol=None,
x509Fingerprint=None,
x509TrustList=None, x509CommonName=None,
- settings=None):
+ settings=None,
+ use_datetime=0):
"""Create a new XMLRPCTransport.
An instance of this class can be passed to L{xmlrpclib.ServerProxy}
@@ -108,8 +109,15 @@
@param settings: Various settings which can be used to control
the ciphersuites, certificate types, and SSL/TLS versions
offered by the client.
+
+ @type use_datetime: bool
+ @param use_datetime: In python 2.5, present date/time values
+ as L{datetime.datetime} and accept L{datetime.datetime},
+ L{datetime.date} and L{datetime.time} objects, if flag is
+ true.
"""
+ self._use_datetime = use_datetime
ClientHelper.__init__(self,
username, password, sharedKey,
certChain, privateKey,
--- tlslite/TLSConnection.py
+++ tlslite/TLSConnection.py
@@ -1545,6 +1545,8 @@
for result in self._sendMsg(alert):
yield result
raise
+ except GeneratorExit:
+ raise
except:
self._shutdown(False)
raise
@@ -1570,6 +1572,8 @@
raise TLSFaultError(str(alert))
else:
pass
+ except GeneratorExit:
+ raise
except:
self._shutdown(False)
raise
--- tlslite/TLSRecordLayer.py
+++ tlslite/TLSRecordLayer.py
@@ -218,6 +218,8 @@
returnStr = self._readBuffer[:max]
self._readBuffer = self._readBuffer[max:]
yield returnStr
+ except GeneratorExit:
+ raise
except:
self._shutdown(False)
raise
@@ -269,6 +271,8 @@
yield result
skipEmptyFrag = True #only send an empy fragment on 1st message
index += 1
+ except GeneratorExit:
+ raise
except:
self._shutdown(False)
raise
@@ -333,6 +337,8 @@
self._shutdown(True)
else:
raise TLSRemoteAlert(alert)
+ except GeneratorExit:
+ raise
except (socket.error, TLSAbruptCloseError):
#If the other side closes the socket, that's okay
self._shutdown(True)
--- tlslite/utils/compat.py
+++ tlslite/utils/compat.py
@@ -48,6 +48,9 @@
def __iter__(self):
return iter(set.values.keys())
+if sys.version_info < (2,5):
+ class GeneratorExit(Exception):
+ pass
if os.name != "java":