changeset 52040:5713adc51f2a

branching: merge stable into default
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 15 Oct 2024 13:52:21 +0200
parents c6ed4b359c4c (current diff) cd788962c6d9 (diff)
children 941141c2c475
files hgdemandimport/__init__.py tests/test-demandimport.py tests/test-verify-repo-operations.py
diffstat 3 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/hgdemandimport/__init__.py	Tue Oct 01 12:29:10 2024 +0200
+++ b/hgdemandimport/__init__.py	Tue Oct 15 13:52:21 2024 +0200
@@ -63,6 +63,7 @@
     '_weakrefset',
     'warnings',
     'threading',
+    'collections.abc',
 }
 
 _pypy = '__pypy__' in sys.builtin_module_names
--- a/tests/test-demandimport.py	Tue Oct 01 12:29:10 2024 +0200
+++ b/tests/test-demandimport.py	Tue Oct 15 13:52:21 2024 +0200
@@ -149,18 +149,18 @@
 assert f(type(re.stderr)) == "<class '_io.TextIOWrapper'>", f(type(re.stderr))
 assert f(re) == "<module 'sys' (built-in)>"
 
-assert 'telnetlib' not in sys.modules
-import telnetlib
+assert 'wsgiref' not in sys.modules
+import wsgiref
 
-assert isinstance(telnetlib, _LazyModule)
-assert f(telnetlib) == "<module 'telnetlib' from '?'>"
+assert isinstance(wsgiref, _LazyModule)
+assert f(wsgiref) == "<module 'wsgiref' from '?'>"
 
 try:
-    from telnetlib import unknownattr
+    from wsgiref import unknownattr
 
     assert False, (
         'no demandmod should be created for attribute of non-package '
-        'module:\ntelnetlib.unknownattr = %s' % f(unknownattr)
+        'module:\nwsgiref.unknownattr = %s' % f(unknownattr)
     )
 except ImportError as inst:
     assert rsub(r"'", '', str(inst)).startswith(
@@ -177,8 +177,8 @@
 
 
 # test deactivation for issue6725
-del sys.modules['telnetlib']
+del sys.modules['wsgiref']
 with demandimport.deactivated():
-    import telnetlib
-assert telnetlib.__loader__ == telnetlib.__spec__.loader
-assert telnetlib.__loader__.get_resource_reader
+    import wsgiref
+assert wsgiref.__loader__ == wsgiref.__spec__.loader
+assert wsgiref.__loader__.get_resource_reader
--- a/tests/test-verify-repo-operations.py	Tue Oct 01 12:29:10 2024 +0200
+++ b/tests/test-verify-repo-operations.py	Tue Oct 15 13:52:21 2024 +0200
@@ -36,7 +36,7 @@
 
 import binascii
 from contextlib import contextmanager
-import pipes
+import shlex
 import shutil
 import silenttestrunner
 import subprocess
@@ -267,7 +267,7 @@
         if os.path.exists(path):
             return
         self.log.append(
-            "$ mkdir -p -- %s" % (pipes.quote(os.path.relpath(path)),)
+            "$ mkdir -p -- %s" % (shlex.quote(os.path.relpath(path)),)
         )
         os.makedirs(path)
 
@@ -276,7 +276,7 @@
         if path == ".":
             return
         os.chdir(path)
-        self.log.append("$ cd -- %s" % (pipes.quote(path),))
+        self.log.append("$ cd -- %s" % (shlex.quote(path),))
 
     def hg(self, *args):
         extra_flags = []
@@ -286,7 +286,7 @@
         self.command("hg", *(tuple(extra_flags) + args))
 
     def command(self, *args):
-        self.log.append("$ " + ' '.join(map(pipes.quote, args)))
+        self.log.append("$ " + ' '.join(map(shlex.quote, args)))
         subprocess.check_output(args, stderr=subprocess.STDOUT)
 
     # Section: Set up basic data
@@ -355,7 +355,7 @@
             )
             % (
                 binascii.hexlify(content),
-                pipes.quote(path),
+                shlex.quote(path),
             )
         )
 
@@ -405,7 +405,7 @@
         if amend:
             errors.append("cannot amend public changesets")
             command.append("--amend")
-        command.append("-m" + pipes.quote(message))
+        command.append("-m" + shlex.quote(message))
         if secret:
             command.append("--secret")
         if close_branch: