[python26-m2crypto/el5/master: 46/78] - Update m2urllib2 to match the Python 2.5 code instead

gholms gholms at fedoraproject.org
Wed Feb 23 00:29:07 UTC 2011


commit 40f17b580905c086b4b17e89e8e759c92e784f48
Author: Miloslav Trmac <mitr at fedoraproject.org>
Date:   Wed Jun 11 13:37:30 2008 +0000

    - Update m2urllib2 to match the Python 2.5 code instead

 m2crypto-0.18.2-inspect.patch |   47 +++++++++++++++++++++++++++++++++-------
 m2crypto.spec                 |    5 +++-
 2 files changed, 42 insertions(+), 10 deletions(-)
---
diff --git a/m2crypto-0.18.2-inspect.patch b/m2crypto-0.18.2-inspect.patch
index 3dacd9e..3a6eb4e 100644
--- a/m2crypto-0.18.2-inspect.patch
+++ b/m2crypto-0.18.2-inspect.patch
@@ -1,11 +1,40 @@
-diff -urN m2crypto/M2Crypto/m2urllib2.py m2crypto-0.18.2/M2Crypto/m2urllib2.py
---- m2crypto/M2Crypto/m2urllib2.py	2007-06-08 20:56:57.000000000 +0200
-+++ m2crypto-0.18.2/M2Crypto/m2urllib2.py	2008-06-07 22:18:26.000000000 +0200
-@@ -11,6 +11,7 @@
-  - Add the M2Crypto HTTPSHandler when building a default opener.
- """
+diff -up m2crypto-0.18.2/M2Crypto/m2urllib2.py~ m2crypto-0.18.2/M2Crypto/m2urllib2.py
+--- m2crypto-0.18.2/M2Crypto/m2urllib2.py~	2007-06-08 20:56:57.000000000 +0200
++++ m2crypto-0.18.2/M2Crypto/m2urllib2.py	2008-06-11 15:17:46.000000000 +0200
+@@ -2,7 +2,7 @@
+ M2Crypto enhancement to Python's urllib2 for handling 
+ 'https' url's.
  
-+import inspect
- from urllib2 import *
- import urlparse
+-Code from urllib2 is Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006
++Code from urllib2 is Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Python Software Foundation; All Rights Reserved
  
+ Summary of changes:
+@@ -102,6 +102,9 @@ def build_opener(ssl_context = None, *ha
+     If any of the handlers passed as arguments are subclasses of the
+     default handlers, the default handlers will not be used.
+     """
++    import types
++    def isclass(obj):
++        return isinstance(obj, types.ClassType) or hasattr(obj, "__bases__")
+ 
+     opener = OpenerDirector()
+     default_classes = [ProxyHandler, UnknownHandler, HTTPHandler,
+@@ -110,7 +113,7 @@ def build_opener(ssl_context = None, *ha
+     skip = []
+     for klass in default_classes:
+         for check in handlers:
+-            if inspect.isclass(check):
++            if isclass(check):
+                 if issubclass(check, klass):
+                     skip.append(klass)
+             elif isinstance(check, klass):
+@@ -127,7 +130,7 @@ def build_opener(ssl_context = None, *ha
+ 
+ 
+     for h in handlers:
+-        if inspect.isclass(h):
++        if isclass(h):
+             h = h()
+         opener.add_handler(h)
+     return opener
diff --git a/m2crypto.spec b/m2crypto.spec
index 1c96db0..392cec1 100644
--- a/m2crypto.spec
+++ b/m2crypto.spec
@@ -6,7 +6,7 @@
 Summary: Support for using OpenSSL in python scripts
 Name: m2crypto
 Version: 0.18.2
-Release: 6
+Release: 7
 Source0: http://wiki.osafoundation.org/pub/Projects/MeTooCrypto/m2crypto-%{version}.tar.gz
 Patch0: m2crypto-0.18-timeouts.patch
 Patch1: m2crypto-0.18-proxy.patch
@@ -81,6 +81,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitearch}/M2Crypto-*.egg-info
 
 %changelog
+* Wed Jun 11 2008 Miloslav Trmač <mitr at redhat.com> - 0.18.2-7
+- Update m2urllib2 to match the Python 2.5 code instead
+
 * Sun Jun  8 2008 Miloslav Trmač <mitr at redhat.com> - 0.18.2-6
 - Don't remove the User-Agent header from proxied requests
   Related: #448858


More information about the scm-commits mailing list