diff mbox

[KVM-AUTOTEST,15/26] KVM test: kvm_monitor.py: don't unpack socket.error args

Message ID 1294751618-21631-15-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Jan. 11, 2011, 1:13 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_monitor.py b/client/tests/kvm/kvm_monitor.py
index 5d3422e..48d627f 100644
--- a/client/tests/kvm/kvm_monitor.py
+++ b/client/tests/kvm/kvm_monitor.py
@@ -119,9 +119,9 @@  class Monitor:
         while self._data_available():
             try:
                 data = self._socket.recv(1024)
-            except socket.error, (errno, msg):
+            except socket.error, e:
                 raise MonitorSocketError("Could not receive data from monitor "
-                                         "(%s)" % msg)
+                                         "(%s)" % e)
             if not data:
                 break
             s += data
@@ -212,9 +212,9 @@  class HumanMonitor(Monitor):
         try:
             try:
                 self._socket.sendall(cmd + "\n")
-            except socket.error, (errno, msg):
-                raise MonitorSocketError("Could not send monitor command '%s' "
-                                         "(%s)" % (cmd, msg))
+            except socket.error, e:
+                raise MonitorSocketError("Could not send monitor command %r "
+                                         "(%s)" % (cmd, e))
 
         finally:
             self._lock.release()
@@ -484,9 +484,9 @@  class QMPMonitor(Monitor):
         """
         try:
             self._socket.sendall(data)
-        except socket.error, (errno, msg):
+        except socket.error, e:
             raise MonitorSocketError("Could not send data: %r (%s)" %
-                                     (data, msg))
+                                     (data, e))
 
 
     def _get_response(self, id=None, timeout=20):