diff --git a/openpnm/algorithms/metrics/RelativePermeability.py b/openpnm/algorithms/metrics/RelativePermeability.py
index <HASH>..<HASH> 100644
--- a/openpnm/algorithms/metrics/RelativePermeability.py
+++ b/openpnm/algorithms/metrics/RelativePermeability.py
@@ -206,7 +206,7 @@ class RelativePermeability(GenericAlgorithm):
             wp = self.project[self.settings['wp']]
             wp['throat.occupancy'] = 1-throat_mask
             wp['pore.occupancy'] = 1-pore_mask
-        except :
+        except KeyError():
             pass
         return sat
The only problem is except KeyError():
catching classes that do not inherit from BaseException is not allowed!
If I remove KeyError(), it works, but another problem will rise: E<I> do not use bare except!