From 59e3861e82e66fed3c5865b07965c3db2c0bfe42 Mon Sep 17 00:00:00 2001
From: Stephan Seitz <stephan.seitz@fau.de>
Date: Fri, 17 Jan 2020 16:07:36 +0100
Subject: [PATCH] Fix bug related to ParallelDataHandling

```python
    def to_gpu(gpu_version, cpu_version):
        gpu_version = gpu_version.boundary_object_to_index_list
        cpu_version = cpu_version.boundary_object_to_index_list

>       if isinstance(self.data_handling, ParallelDataHandling):
E       TypeError: isinstance() arg 2 must be a type or tuple of types

../pystencils/pystencils/boundaries/boundaryhandling.py:102: TypeError
```

None is not a type! ParallelDataHandling is None if `waLBerla` is not
installed
---
 pystencils/boundaries/boundaryhandling.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pystencils/boundaries/boundaryhandling.py b/pystencils/boundaries/boundaryhandling.py
index 4c3f8aec0..0a33fde2e 100644
--- a/pystencils/boundaries/boundaryhandling.py
+++ b/pystencils/boundaries/boundaryhandling.py
@@ -99,7 +99,7 @@ class BoundaryHandling:
             gpu_version = gpu_version.boundary_object_to_index_list
             cpu_version = cpu_version.boundary_object_to_index_list
 
-            if isinstance(self.data_handling, ParallelDataHandling):
+            if ParallelDataHandling and isinstance(self.data_handling, ParallelDataHandling):
                 array_handler = PyCudaArrayHandler()
             else:
                 array_handler = self.data_handling.array_handler
-- 
GitLab