mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Addresses the other half of Bug #112634 -- the documentation suggested
that you can set self.version *after* calling the base class __init__. In fact it must be done *before*. (Fred, maybe the version class variable should be documented now?)
This commit is contained in:
parent
ba3113807d
commit
3d0c77b37c
1 changed files with 1 additions and 1 deletions
|
@ -176,8 +176,8 @@ accomplished with the following code:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
class AppURLopener(urllib.FancyURLopener):
|
class AppURLopener(urllib.FancyURLopener):
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
apply(urllib.FancyURLopener.__init__, (self,) + args)
|
|
||||||
self.version = "App/1.7"
|
self.version = "App/1.7"
|
||||||
|
apply(urllib.FancyURLopener.__init__, (self,) + args)
|
||||||
|
|
||||||
urllib._urlopener = AppURLopener()
|
urllib._urlopener = AppURLopener()
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue