diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-07-19 12:17:43 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-07-19 12:17:43 -0300 |
commit | e5b50a129f6cb276fd20d9969cb7d300265f40e1 (patch) | |
tree | c6ab9a42b8363317251e4258fa371ed3d4dcdc4b /src/leap/crypto | |
parent | 7ec29145b064afab312cb57e74dc33c38da1e3ea (diff) | |
parent | 0e92595da3844516d9a67bbbbd88c2957f0a29bc (diff) |
Merge remote-tracking branch 'chiiph/bug/signal_emit_segfault' into develop
Diffstat (limited to 'src/leap/crypto')
-rw-r--r-- | src/leap/crypto/srpregister.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/leap/crypto/srpregister.py b/src/leap/crypto/srpregister.py index 24f73504..de1978b5 100644 --- a/src/leap/crypto/srpregister.py +++ b/src/leap/crypto/srpregister.py @@ -124,7 +124,12 @@ class SRPRegister(QtCore.QObject): logger.debug('Post to uri: %s' % uri) logger.debug("Will try to register user = %s" % (username,)) - ok = None + ok = False + # This should be None, but we don't like when PySide segfaults, + # so it something else. + # To reproduce it, just do: + # self.registration_finished.emit(False, None) + req = [] try: req = self._session.post(uri, data=user_data, @@ -132,12 +137,13 @@ class SRPRegister(QtCore.QObject): verify=self._provider_config. get_ca_cert_path()) - except requests.exceptions.SSLError as exc: - logger.error("SSLError: %s" % exc.message) - req = None + except (requests.exceptions.SSLError, + requests.exceptions.ConnectionError) as exc: + logger.error(exc.message) ok = False else: ok = req.ok + self.registration_finished.emit(ok, req) return ok |