Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marcin Mielniczuk
gajim
Commits
4a58bc47
Commit
4a58bc47
authored
Dec 01, 2006
by
junglecow
Browse files
[pyopenssl] Yet more exception fixes
parent
236ed046
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/common/xmpp/transports_nb.py
View file @
4a58bc47
...
...
@@ -79,14 +79,19 @@ class SSLWrapper:
def
__init__
(
this
,
sock
=
None
,
exc
=
None
,
errno
=
None
,
strerror
=
None
,
peer
=
None
):
this
.
parent
=
IOError
this
.
exc
=
exc
errno
=
errno
or
gattr
(
exc
,
'errno'
,
0
)
strerror
=
strerror
or
gattr
(
exc
,
'strerror'
)
or
gattr
(
exc
,
'args'
)
if
not
isinstance
(
strerror
,
basestring
):
strerror
=
repr
(
strerror
)
errno
=
errno
or
gattr
(
this
.
exc
,
'errno'
,
0
)
strerror
=
strerror
or
gattr
(
this
.
exc
,
'strerror'
)
or
gattr
(
this
.
exc
,
'args'
)
this
.
parent
.
__init__
(
this
,
errno
,
strerror
)
this
.
parent
.
__init__
(
this
,
this
.
errno
,
this
.
strerror
)
this
.
sock
=
sock
this
.
exc
=
exc
this
.
peer
=
peer
this
.
exc_name
=
None
this
.
exc_args
=
None
this
.
exc_str
=
None
this
.
exc_repr
=
None
if
this
.
exc
is
not
None
:
this
.
exc_name
=
str
(
this
.
exc
.
__class__
)
...
...
@@ -96,7 +101,7 @@ class SSLWrapper:
if
this
.
peer
is
None
and
sock
is
not
None
:
try
:
ppeer
=
this
.
obj
.
getpeername
()
ppeer
=
this
.
sock
.
getpeername
()
if
len
(
ppeer
)
==
2
and
isinstance
(
ppeer
[
0
],
basestring
)
\
and
isinstance
(
ppeer
[
1
],
int
):
this
.
peer
=
ppeer
...
...
@@ -104,7 +109,7 @@ class SSLWrapper:
def
__str__
(
this
):
s
=
str
(
this
.
__class__
)
if
this
.
peer
:
s
+=
"for %s:%d"
%
this
.
peer
if
this
.
peer
:
s
+=
"
for %s:%d"
%
this
.
peer
if
this
.
errno
is
not
None
:
s
+=
": [Errno: %d]"
%
this
.
errno
if
this
.
strerror
:
s
+=
" (%s)"
%
this
.
strerror
if
this
.
exc_name
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment