diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py
index 8154caf5b901b72b27066b443a1656ae54808831..bf8b7ae27c82c8f3dbec970c591f43a15be51918 100644
--- a/pyopencl/__init__.py
+++ b/pyopencl/__init__.py
@@ -394,7 +394,10 @@ def _mark_copy_deprecated(func):
     except ImportError:
         pass
     else:
-        update_wrapper(new_func, func)
+        try:
+            update_wrapper(new_func, func)
+        except AttributeError:
+            pass
 
     return new_func