diff --git a/contrib/python/cdo.py b/contrib/python/cdo.py
index 4b2930f4a46c11040c9aa41fee1d92542eda443a..0169ec72726636bcee02a39f83d36a3414169489 100644
--- a/contrib/python/cdo.py
+++ b/contrib/python/cdo.py
@@ -160,7 +160,10 @@ class Cdo(object):
     def unsetReturnArray(self):
       self.setReturnArray(False)
 
-    def hasCdo(self,path=self.CDO):
+    def hasCdo(self,path=None):
+      if path is None:
+        path = self.CDO
+
       if os.path.isfile(path) and os.access(path, os.X_OK):
         return True
       return False