summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-10-03 18:33:24 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-10-03 18:33:24 (GMT)
commitbbe7b0ad2a4bc34e5f9ef3b26653ed5c2642d319 (patch)
tree0ab7c7e158f52137ac1add28b5de71a927a8f18e /Lib
parentc3cec7868bf1019c0987f1e9aadb56d73fa93d61 (diff)
downloadcpython-bbe7b0ad2a4bc34e5f9ef3b26653ed5c2642d319.zip
cpython-bbe7b0ad2a4bc34e5f9ef3b26653ed5c2642d319.tar.gz
cpython-bbe7b0ad2a4bc34e5f9ef3b26653ed5c2642d319.tar.bz2
Fix a few ResourceWarnings in idle
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/configHandler.py3
-rw-r--r--Lib/idlelib/rpc.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index 73b8db5..79315ef 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -145,7 +145,8 @@ class IdleUserConfParser(IdleConfParser):
except IOError:
os.unlink(fname)
cfgFile = open(fname, 'w')
- self.write(cfgFile)
+ with cfgFile:
+ self.write(cfgFile)
else:
self.RemoveFile()
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
index 0c56ccd..53f4aa8 100644
--- a/Lib/idlelib/rpc.py
+++ b/Lib/idlelib/rpc.py
@@ -534,6 +534,10 @@ class RPCClient(SocketIO):
def get_remote_proxy(self, oid):
return RPCProxy(self, oid)
+ def close(self):
+ self.listening_sock.close()
+ SocketIO.close(self)
+
class RPCProxy(object):
__methods = None