--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -703,7 +703,7 @@
 
     def close(self):
         reply = self.maybesave()
-        if str(reply) != "cancel":
+        if reply != "cancel":
             self._close()
         return reply