mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix a few ResourceWarnings in idle
This commit is contained in:
parent
c3cec7868b
commit
bbe7b0ad2a
2 changed files with 6 additions and 1 deletions
|
@ -145,7 +145,8 @@ class IdleUserConfParser(IdleConfParser):
|
||||||
except IOError:
|
except IOError:
|
||||||
os.unlink(fname)
|
os.unlink(fname)
|
||||||
cfgFile = open(fname, 'w')
|
cfgFile = open(fname, 'w')
|
||||||
self.write(cfgFile)
|
with cfgFile:
|
||||||
|
self.write(cfgFile)
|
||||||
else:
|
else:
|
||||||
self.RemoveFile()
|
self.RemoveFile()
|
||||||
|
|
||||||
|
|
|
@ -534,6 +534,10 @@ class RPCClient(SocketIO):
|
||||||
def get_remote_proxy(self, oid):
|
def get_remote_proxy(self, oid):
|
||||||
return RPCProxy(self, oid)
|
return RPCProxy(self, oid)
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
self.listening_sock.close()
|
||||||
|
SocketIO.close(self)
|
||||||
|
|
||||||
class RPCProxy(object):
|
class RPCProxy(object):
|
||||||
|
|
||||||
__methods = None
|
__methods = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue