From 234619864b7a9bef60feb14c9ccab9cfb3302f90 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 18 Feb 2013 12:59:44 +0000 Subject: [PATCH] Compile with Python 2 --- panda/src/nativenet/buffered_datagramconnection.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/nativenet/buffered_datagramconnection.h b/panda/src/nativenet/buffered_datagramconnection.h index 6214c19357..0935f03b78 100755 --- a/panda/src/nativenet/buffered_datagramconnection.h +++ b/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);