Commit 7ca952d7 authored by Kliment Yanev's avatar Kliment Yanev

Don't crash the connect function if the error has no string equivalent. Fixes #732

parent e494faa6
...@@ -182,6 +182,7 @@ class printcore(): ...@@ -182,6 +182,7 @@ class printcore():
self.printer_tcp.settimeout(self.timeout) self.printer_tcp.settimeout(self.timeout)
self.printer = self.printer_tcp.makefile() self.printer = self.printer_tcp.makefile()
except socket.error as e: except socket.error as e:
if(e.strerror is None): e.strerror=""
self.logError(_("Could not connect to %s:%s:") % (hostname, port) + self.logError(_("Could not connect to %s:%s:") % (hostname, port) +
"\n" + _("Socket error %s:") % e.errno + "\n" + _("Socket error %s:") % e.errno +
"\n" + e.strerror) "\n" + e.strerror)
......
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