[pypy-commit] pypy py3.6: fix typos, also posix.environ returns bytes

mattip pypy.commits at gmail.com
Sun Feb 2 12:49:38 EST 2020


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r98642:4611cc30e74d
Date: 2020-02-02 19:32 +0200
http://bitbucket.org/pypy/pypy/changeset/4611cc30e74d/

Log:	fix typos, also posix.environ returns bytes

diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -934,11 +934,11 @@
 
     if hasattr(rposix, 'posix_fallocate'):
         def test_os_posix_posix_fallocate(self):
-            posix, self.posix
+            os = self.posix
             import errno
-            fd = posix.open(self.path2 + 'test_os_posix_fallocate', os.O_WRONLY | os.O_CREAT)
+            fd = os.open(self.path2 + 'test_os_posix_fallocate', os.O_WRONLY | os.O_CREAT)
             try:
-                ret = posix.posix_fallocate(fd, 0, 10)
+                ret = os.posix_fallocate(fd, 0, 10)
                 if ret == errno.EINVAL and not self.runappdirect:
                     # Does not work untranslated on a 32-bit chroot/docker
                     pass
@@ -951,7 +951,7 @@
                 if inst.errno != errno.EINVAL or not sys.platform.startswith("sunos"):
                     raise
             finally:
-                posix.close(fd)
+                os.close(fd)
 
 
     def test_largefile(self):
@@ -1602,6 +1602,7 @@
 
 class AppTestEnvironment(object):
     def setup_class(cls):
+        cls.w_posix = space.appexec([], GET_POSIX)
         cls.w_path = space.wrap(str(path))
 
     def test_environ(self):
@@ -1609,8 +1610,8 @@
         if not environ:
             skip('environ not filled in for untranslated tests')
         for k, v in environ.items():
-            assert type(k) is str
-            assert type(v) is str
+            assert type(k) is bytes
+            assert type(v) is bytes
         name = next(iter(environ))
         assert environ[name] is not None
         del environ[name]


More information about the pypy-commit mailing list