Commit 52af3703 authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Type.ConnectionPlugin.SFTPConnection: Fix gaierror access.

parent bb8dc227
......@@ -29,7 +29,7 @@
import os, socket
from urlparse import urlparse
from socket import error, socket, getaddrinfo, AF_UNSPEC, SOCK_STREAM
from socket import gaierror, error, socket, getaddrinfo, AF_UNSPEC, SOCK_STREAM
from xmlrpclib import Binary
from cStringIO import StringIO
from paramiko import Transport, RSAKey, SFTPClient
......@@ -93,7 +93,7 @@ class SFTPConnection:
raise SFTPError("No password or private_key defined")
# Connect
self.conn = SFTPClient.from_transport(self.transport)
except (socket.gaierror,error), msg:
except (gaierror, error), msg:
raise SFTPError(str(msg) + ' while establishing connection to %s' % (self.url,))
# Go to specified directory
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment