From cc53e11b35929e23311242961dbd6cc98664747c Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 27 Jun 2009 20:32:14 -0400
Subject: [PATCH] Use a better test for numpy complex-ness in match_precision.

---
 pytools/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pytools/__init__.py b/pytools/__init__.py
index 7e9be32..96faa77 100644
--- a/pytools/__init__.py
+++ b/pytools/__init__.py
@@ -1293,7 +1293,7 @@ def match_precision(dtype, dtype_to_match):
     tgt_is_double = dtype_to_match in [
             numpy.float64, numpy.complex128]
 
-    dtype_is_complex = complex in dtype.type.__mro__
+    dtype_is_complex = dtype.kind == "c"
     if dtype_is_complex:
         if tgt_is_double:
             return numpy.dtype(numpy.complex128)
-- 
GitLab