From 472832e915d739baf6950262c01d86effe0ae089 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Wed, 11 Mar 2015 18:25:02 +0100 Subject: [PATCH] fixed ssl context for python < 2.7.9 --- manifoldapi/manifoldapi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.43.0