<s> """<STR_LIT>""" <EOL> from httplib import HTTP <EOL> from mechanize import Browser as MechanizeBrowser <EOL> from wsgi_intercept . urllib2_intercept import install_opener , uninstall_opener <EOL> try : <EOL> from mechanize import HTTPHandler <EOL> except ImportError : <EOL> from ClientCookie import HTTPHandler <EOL> import sys , os . path <EOL> from wsgi_intercept . urllib2_intercept import WSGI_HTTPHandler , WSGI_HTTPSHandler <EOL> class Browser ( MechanizeBrowser ) : <EOL> """<STR_LIT>""" <EOL> handler_classes = MechanizeBrowser . handler_classes . copy ( ) <EOL> handler_classes [ '<STR_LIT:http>' ] = WSGI_HTTPHandler <EOL> handler_classes [ '<STR_LIT>' ] = WSGI_HTTPSHandler <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> install ( self ) <EOL> MechanizeBrowser . __init__ ( self , * args , ** kwargs ) <EOL> def install ( browser ) : <EOL> install_opener ( ) </s>
