From: Benjamin Peterson Date: Thu, 12 Feb 2009 04:17:04 +0000 (+0000) Subject: no need for this __bases__ trick anymore X-Git-Tag: v2.7a1~2050 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bb96feb60b80b580706e3a2c67db856382a530f;p=python no need for this __bases__ trick anymore --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index e108b29d33..a2a7e66c83 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -441,7 +441,7 @@ def build_opener(*handlers): """ import types def isclass(obj): - return isinstance(obj, types.ClassType) or hasattr(obj, "__bases__") + return isinstance(obj, (types.ClassType, type)) opener = OpenerDirector() default_classes = [ProxyHandler, UnknownHandler, HTTPHandler,