mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
without handler. (backport from rev. 56293)
This commit is contained in:
parent
ad4b263ba7
commit
40df67f704
2 changed files with 10 additions and 0 deletions
|
@ -298,6 +298,10 @@ class OpenerDirector:
|
|||
self.process_request = {}
|
||||
|
||||
def add_handler(self, handler):
|
||||
if not hasattr(handler, "add_parent"):
|
||||
raise TypeError("expected BaseHandler instance, got %r" %
|
||||
type(handler))
|
||||
|
||||
added = False
|
||||
for meth in dir(handler):
|
||||
if meth in ["redirect_request", "do_open", "proxy_open"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue