Changeset: 27d155c69583 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/27d155c69583
Modified Files:
        testing/Mtest.py.in
        testing/listexports.py
        testing/process.py
Branch: Aug2024
Log Message:

Python 3.6 compatibility.


diffs (100 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1306,7 +1306,7 @@ def PerformDir(env, testdir, testlist, t
                         cmd = env['exe']['mserver5'] + ['--set', 
f'gdk_dbname={TSTDB}', '--in-memory'] + mserver5_opts + opts
                         pollfile = None
                         cmd.append('--set')
-                        cmd.append(f'gdk_dbtrace={os.path.join(LogDBdir, 
'mdbtrace.log')}')
+                        cmd.append(f'gdk_dbtrace={os.path.join(LogDBdir, 
"mdbtrace.log")}')
                     else:
                         cmd = env['exe']['mserver5'] + 
[f'--dbpath={LogDBdir}'] + mserver5_opts + opts
                         pollfile = os.path.join(LogDBdir, '.started')
@@ -2903,7 +2903,7 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
                 Srvr.append('--dbpath=%s' % dbpath)
                 if os.path.exists(os.path.join(dbpath, '.vaultkey')):
                     Srvr.extend(['--set',
-                                 f'monet_vault_key={os.path.join(dbpath, 
'.vaultkey')}'])
+                                 f'monet_vault_key={os.path.join(dbpath, 
".vaultkey")}'])
                 if env.get('MULTIFARM'):
                     Srvr.append('--dbextra=%s' % 
os.path.join(env['GDK_DBFARM'], TSTDB + '_transient'))
                     shutil.rmtree(os.path.join(env['GDK_DBFARM'], TSTDB + 
'_transient'),
@@ -4234,7 +4234,7 @@ VALUES (%s, '%s', '%s', '%s',
             print()
             print(f'failed={Failed}, skipped={len(Failure[F_SKIP])}')
             if produce_html and (Failed or errseen):
-                print(f'see {urllib.parse.urlunsplit(('file', '', 
urllib.request.pathname2url(os.path.join(TSTTRGBASE, TSTPREF, 'index.html')), 
'', ''))}')
+                print(f'see {urllib.parse.urlunsplit(("file", "", 
urllib.request.pathname2url(os.path.join(TSTTRGBASE, TSTPREF, "index.html")), 
"", ""))}')
             print(f'Ran {num_tests - len(Failure[F_SKIP])} tests in 
{t_:7.3f}s')
         elif Failed:
             print('''\
diff --git a/testing/listexports.py b/testing/listexports.py
--- a/testing/listexports.py
+++ b/testing/listexports.py
@@ -109,7 +109,7 @@ def getrepofiles():
         import subprocess
         with subprocess.Popen(['hg', '--config', 'ui.verbose=False', 'files', 
'-I', '**.[ch]'],
                               stdout=subprocess.PIPE,
-                              text=True) as p:
+                              universal_newlines=True) as p:
             out, err = p.communicate()
         fileset = set([os.path.join(srcdir, f) for f in filter(None, 
out.split('\n'))])
     else:
diff --git a/testing/process.py b/testing/process.py
--- a/testing/process.py
+++ b/testing/process.py
@@ -99,13 +99,14 @@ class _BufferedPipe:
         self._thread = threading.Thread(target=self._readerthread,
                                         args=(fd, self._queue))
         # self._thread.daemon = True
+        self._continue = True
         self._thread.start()
 
     def _readerthread(self, fh, q):
         s = 0
         w = 0
         first = True
-        while True:
+        while self._continue:
             if verbose:
                 print('fh.readline', flush=True)
             c = fh.readline()
@@ -117,20 +118,19 @@ class _BufferedPipe:
                     self._nl = b'\n'
                     self._cr = b'\r'
                     first = False
-            try:
-                if not c:
-                    q.put(c)    # put '' if at EOF
-                    break
-                c = c.replace(self._cr, self._empty)
-                if c:
-                    q.put(c)
-            except queue.ShutDown:
+            if not self._continue:
                 break
+            if not c:
+                q.put(c)    # put '' if at EOF
+                break
+            c = c.replace(self._cr, self._empty)
+            if c:
+                q.put(c)
 
     def close(self):
         if verbose:
             print('close _BufferedPipe', flush=True)
-        self._queue.shutdown()
+        self._continue = False
         if self._thread:
             if verbose:
                 print('close: joining', flush=True)
@@ -167,9 +167,6 @@ class _BufferedPipe:
             except queue.Empty:
                 print('queue.empty', flush=True)
                 break
-            except queue.ShutDown:
-                print('queue shut down', flush=True)
-                break
             if len(c) > size > 0:
                 ret.append(c[:size])
                 self._cur = c[size:]
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to