X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifoldapi%2Fmanifoldapi.py;h=0fc403392bc24e279d928d4ba60db2653021b1cc;hb=b442e43f8880d48800717e6b33d3c79f23945a2d;hp=29236c0fcdfa0db9226db139de06d06be125df9a;hpb=47875c18877f9c482861cdede4832b94f13a11c3;p=myslice.git diff --git a/manifoldapi/manifoldapi.py b/manifoldapi/manifoldapi.py index 29236c0f..0fc40339 100644 --- a/manifoldapi/manifoldapi.py +++ b/manifoldapi/manifoldapi.py @@ -27,11 +27,10 @@ class ManifoldAPI: # Manifold uses a self signed certificate # https://www.python.org/dev/peps/pep-0476/ - 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) + try: turn_off_server_verify = { 'context' : ssl._create_unverified_context() } + except: turn_off_server_verify = {} + self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True, + **turn_off_server_verify) # xxx temporary code for scaffolding a ManifolResult on top of an API that does not expose error info # as of march 2013 we work with an API that essentially either returns the value, or raises