Просмотр исходного кода

raise ValueError on out-of-range

David Rose 17 лет назад
Родитель
Сommit
4c3e9643f3
1 измененных файлов с 17 добавлено и 1 удалено
  1. 17 1
      direct/src/distributed/cDistributedSmoothNodeBase.cxx

+ 17 - 1
direct/src/distributed/cDistributedSmoothNodeBase.cxx

@@ -17,6 +17,7 @@
 #include "dcField.h"
 #include "dcField.h"
 #include "dcClass.h"
 #include "dcClass.h"
 #include "dcmsgtypes.h"
 #include "dcmsgtypes.h"
+#include "config_distributed.h"
 
 
 static const float smooth_node_epsilon = 0.01;
 static const float smooth_node_epsilon = 0.01;
 static const double network_time_precision = 100.0;  // Matches ClockDelta.py
 static const double network_time_precision = 100.0;  // Matches ClockDelta.py
@@ -349,10 +350,25 @@ finish_send_update(DCPacker &packer) {
             << _node_path << " pos = " << _store_xyz
             << _node_path << " pos = " << _store_xyz
             << " hpr = " << _store_hpr
             << " hpr = " << _store_hpr
             << " zoneId = " << _currL[0];
             << " zoneId = " << _currL[0];
+
+#ifdef HAVE_PYTHON
+      string message = error.str();
+      distributed_cat.warning()
+        << message << "\n";
+      PyErr_SetString(PyExc_ValueError, message.c_str());
+#else
       nassert_raise(error.str());
       nassert_raise(error.str());
+#endif
 
 
     } else {
     } else {
-      nassert_raise("Unexpected pack error in DC file.");
+      const char *message = "Unexpected pack error in DC file.";
+#ifdef HAVE_PYTHON
+      distributed_cat.warning()
+        << message << "\n";
+      PyErr_SetString(PyExc_TypeError, message);
+#else
+      nassert_raise(message);
+#endif
     }
     }
 #endif
 #endif
   }
   }