DebuggerInterfacePython: added a check to handle a situation where flush() is called while the socket is still unknown.

Sun, 23 Feb 2020 13:19:20 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 23 Feb 2020 13:19:20 +0100
changeset 7429
6983c461550f
parent 7427
362cd1b6f81a
child 7430
79eb37083821

DebuggerInterfacePython: added a check to handle a situation where flush() is called while the socket is still unknown.

eric6/Debugger/DebuggerInterfacePython.py file | annotate | diff | comparison | revisions
eric6/Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/eric6/Debugger/DebuggerInterfacePython.py	Sat Feb 22 14:27:42 2020 +0100
+++ b/eric6/Debugger/DebuggerInterfacePython.py	Sun Feb 23 13:19:20 2020 +0100
@@ -519,11 +519,12 @@
         """
         Public slot to flush the queue.
         """
-        # Send commands that were waiting for the connection.
-        for cmd in self.queue:
-            self.__writeJsonCommandToSocket(cmd)
-        
-        self.queue = []
+        if self.qsock is not None:
+            # Send commands that were waiting for the connection.
+            for cmd in self.queue:
+                self.__writeJsonCommandToSocket(cmd)
+            
+            self.queue = []
     
     def shutdown(self):
         """
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat Feb 22 14:27:42 2020 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Feb 23 13:19:20 2020 +0100
@@ -3179,19 +3179,21 @@
         args.append('paths')
         
         output, error = self.__client.runcommand(args)
+        print(output, error)
         
         self.__defaultConfigured = False
         self.__defaultPushConfigured = False
         if output:
             for line in output.splitlines():
+                line = line.strip()
                 if (
                     line.startswith("paths.default=") and
-                    not line.strip().endswith("=")
+                    not line.endswith("=")
                 ):
                     self.__defaultConfigured = True
                 if (
                     line.startswith("paths.default-push=") and
-                    not line.strip().endswith("=")
+                    not line.endswith("=")
                 ):
                     self.__defaultPushConfigured = True
     

eric ide

mercurial