Kaydet (Commit) 112ea6bf authored tarafından Guido van Rossum's avatar Guido van Rossum

Inspired by Greg Stein's proposed simplification of the _closesocket

class, I came up with an even simpler solution: raise the error in
__getattr__().
üst aa32070f
......@@ -155,13 +155,9 @@ class _socketobject:
class _closedsocket:
def _bummer(self):
def __getattr__(self, name):
raise error(9, 'Bad file descriptor')
_s = "def %s(self, *args): self._bummer()\n\n"
for _m in _socketmethods:
exec _s % _m
class _fileobject:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment