File patch_fix_py34_mock_1.0.1.patch of Package python3-mock

From: toddrme2178@gmail.com
Date: 2014-07-18 13:54:00 +0000
Subject: Fix building on python 3.4
References: https://bugs.launchpad.net/ubuntu/+source/python-mock/+bug/1283742
Upstream: never

python-mock isn't compatible with python 3.4.  python 3.4 has its own build-in version,
but a lot of packages still use the external version.  This will probably never be 
upstreamed because python-mock is likely essentially deprecated, this is just a stop-gap
measure until packages port over to the built-in version.

diff -r d356250e275d mock.py
--- a/mock.py	Tue Apr 09 14:53:33 2013 +0100
+++ b/mock.py	Wed Feb 26 15:12:18 2014 -0500
@@ -239,12 +239,21 @@
     funcopy.__name__ = func.__name__
     funcopy.__doc__ = func.__doc__
     #funcopy.__dict__.update(func.__dict__)
-    funcopy.__module__ = func.__module__
+    try:
+        funcopy.__module__ = func.__module__
+    except AttributeError:
+        pass
     if not inPy3k:
         funcopy.func_defaults = func.func_defaults
         return
-    funcopy.__defaults__ = func.__defaults__
-    funcopy.__kwdefaults__ = func.__kwdefaults__
+    try:
+        funcopy.__defaults__ = func.__defaults__
+    except AttributeError:
+        pass
+    try:
+        funcopy.__kwdefaults__ = func.__kwdefaults__
+    except AttributeError:
+        pass
 
 
 def _callable(obj):
openSUSE Build Service is sponsored by