Commits

Sjoerd Mullender committed 513a96a

Removed addbase.__del__ because it can't work.
If code keeps a reference to self.fp or any of its methods, you don't
want to close self.fp just because no explicit reference is kept to self.

  • Participants
  • Parent commits 1a8d6c7
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/urllib.py

 	def __repr__(self):
 		return '<%s at %s whose fp = %s>' % (
 			  self.__class__.__name__, `id(self)`, `self.fp`)
-	def __del__(self):
-		self.close()
+# Removed this __del__ because it can't work like this.  If a
+# reference is kept to self.fp or any of its methods, but no reference
+# is kept to self, we don't want to close self.fp (which would happen
+# if this __del__ still existed).
+#	def __del__(self):
+#		self.close()
 	def close(self):
 		self.read = None
 		self.readline = None