Fix for the case imported module is unable to reference in __del__()
@@ -136,6 +136,8 @@ class Stream(object):
def __del__(self):
if self.ptr:
+ # https://stackoverflow.com/questions/8590238/unable-to-reference-an-imported-module-in-del
+ if runtime:
runtime.streamDestroy(self.ptr)
def __enter__(self):
