From: Ciro Scognamiglio Date: Wed, 11 Mar 2015 17:25:02 +0000 (+0100) Subject: fixed ssl context for python < 2.7.9 X-Git-Tag: myslice-1.3~58^2~2 X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=472832e915d739baf6950262c01d86effe0ae089 fixed ssl context for python < 2.7.9 --- diff --git a/manifoldapi/manifoldapi.py b/manifoldapi/manifoldapi.py index c6eea10a..796d0a52 100644 --- a/manifoldapi/manifoldapi.py +++ b/manifoldapi/manifoldapi.py @@ -44,8 +44,10 @@ class ManifoldAPI: # Manifold uses a self signed certificate # https://www.python.org/dev/peps/pep-0476/ - context = ssl._create_unverified_context() - self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True, context=context) + if hasattr(ssl, '_create_unverified_context'): + self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True, context=ssl._create_unverified_context()) + else : + self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True) def __repr__ (self): return "ManifoldAPI[%s]"%self.url