Re: Does class patching actually work

2007-01-16 Thread John Nagle
James Stroud wrote: > John Nagle wrote: >> The intent of this is to replace method open_https of class URLopener >> with a local, patched version. >> >> Does that actually work? When I've tried to do that in other code, it >> seems to have no effect. In fact, I can write >> >> URLopener.open

Re: Does class patching actually work

2007-01-15 Thread James Stroud
John Nagle wrote: > In M2Crypto/m2urllib there is this: > > import string, sys, urllib > from urllib import * > > def open_https(self, url, data=None, ssl_context=None): > ... > > # Minor brain surgery. > URLopener.open_https = open_https > > The intent of this is to re

Does class patching actually work

2007-01-15 Thread John Nagle
In M2Crypto/m2urllib there is this: import string, sys, urllib from urllib import * def open_https(self, url, data=None, ssl_context=None): ... # Minor brain surgery. URLopener.open_https = open_https The intent of this is to replace method open_