Browse Source

Compile with Python 2

rdb 13 years ago
parent
commit
234619864b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      panda/src/nativenet/buffered_datagramconnection.h

+ 5 - 0
panda/src/nativenet/buffered_datagramconnection.h

@@ -243,7 +243,12 @@ inline bool  Buffered_DatagramConnection::SendMessage(const Datagram &msg)
         nativenet_cat.warning() << "Buffered_DatagramConnection::SendMessage->Error On Write--Out Buffer = " << _Writer.AmountBuffered() << "\n";
         #ifdef HAVE_PYTHON
         ostringstream s;
+
+#if PY_MAJOR_VERSION >= 3
         PyObject *exc_type = PyExc_ConnectionError;
+#else
+        PyObject *exc_type = PyExc_StandardError;
+#endif
         
         s << endl << "Error sending message: " << endl;
         msg.dump_hex(s);