Browse Source

interval: Fix ability to await Sequence objects

rdb 4 years ago
parent
commit
03b96edfbc
1 changed files with 4 additions and 1 deletions
  1. 4 1
      direct/src/interval/cInterval_ext.cxx

+ 4 - 1
direct/src/interval/cInterval_ext.cxx

@@ -51,7 +51,10 @@ __await__(PyObject *self) {
     return nullptr;
     return nullptr;
   }
   }
 
 
-  _this->start();
+  // This may be overridden from Python (such as is the case for Sequence), so
+  // we call this via Python.
+  PyObject *result = PyObject_CallMethod(self, "start", nullptr);
+  Py_XDECREF(result);
   return Dtool_NewGenerator(self, &gen_next);
   return Dtool_NewGenerator(self, &gen_next);
 }
 }