Author: Matti Picus <matti.pi...@gmail.com> Branch: py3.6 Changeset: r96118:02cb9ab27bd1 Date: 2019-02-20 20:05 +0200 http://bitbucket.org/pypy/pypy/changeset/02cb9ab27bd1/
Log: merge heads 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 @@ -23,6 +23,8 @@ mod.path = udir.join('posixtestfile.txt') mod.path.write("this is a test") mod.path2 = udir.join('test_posix2-') + mod.path3 = udir.join('unlinktestfile.txt') + mod.path3.write("delete me!") pdir = udir.ensure('posixtestdir', dir=True) pdir.join('file1').write("test1") os.chmod(str(pdir.join('file1')), 0o600) @@ -66,6 +68,7 @@ cls.w_os = space.appexec([], "(): import os as m ; return m") cls.w_path = space.wrap(str(path)) cls.w_path2 = space.wrap(str(path2)) + cls.w_path3 = space.wrap(str(path3)) cls.w_pdir = space.wrap(str(pdir)) cls.w_bytes_dir = space.newbytes(str(bytes_dir)) cls.w_esurrogate_dir = space.newbytes(str(esurrogate_dir)) @@ -391,7 +394,7 @@ def test_unlink(self): os = self.posix - path = self.path + path = self.path3 with open(path, 'wb'): pass class Path: diff --git a/pypy/module/readline/test/test_readline.py b/pypy/module/readline/test/test_readline.py --- a/pypy/module/readline/test/test_readline.py +++ b/pypy/module/readline/test/test_readline.py @@ -1,5 +1,14 @@ # -*- coding: utf-8 -*- import sys +import pytest + +def setup_module(mod): + try: + import curses + curses.setupterm() + except: + pytest.skip("Cannot test this here") + class AppTestReadline: spaceconfig = dict(usemodules=[ diff --git a/pypy/module/sys/vm.py b/pypy/module/sys/vm.py --- a/pypy/module/sys/vm.py +++ b/pypy/module/sys/vm.py @@ -149,23 +149,21 @@ p = frame.last_instr if (ord(co[p]) == stdlib_opcode.CALL_FUNCTION or ord(co[p]) == stdlib_opcode.CALL_METHOD): - if ord(co[p+3]) == stdlib_opcode.LOAD_CONST: - lo = ord(co[p+4]) - hi = ord(co[p+5]) - w_constant = frame.getconstant_w((hi * 256) | lo) - if ord(co[p+6]) == stdlib_opcode.BINARY_SUBSCR: + if ord(co[p + 2]) == stdlib_opcode.LOAD_CONST: + lo = ord(co[p + 3]) + w_constant = frame.getconstant_w(lo) + if ord(co[p + 4]) == stdlib_opcode.BINARY_SUBSCR: if space.isinstance_w(w_constant, space.w_int): constant = space.int_w(w_constant) if -3 <= constant <= 1 and constant != -1: need_all_three_args = False - elif (ord(co[p+6]) == stdlib_opcode.LOAD_CONST and - ord(co[p+9]) == stdlib_opcode.BUILD_SLICE and - ord(co[p+12]) == stdlib_opcode.BINARY_SUBSCR): + elif (ord(co[p + 4]) == stdlib_opcode.LOAD_CONST and + ord(co[p + 6]) == stdlib_opcode.BUILD_SLICE and + ord(co[p + 8]) == stdlib_opcode.BINARY_SUBSCR): if (space.is_w(w_constant, space.w_None) or space.isinstance_w(w_constant, space.w_int)): - lo = ord(co[p+7]) - hi = ord(co[p+8]) - w_constant = frame.getconstant_w((hi * 256) | lo) + lo = ord(co[p + 5]) + w_constant = frame.getconstant_w(lo) if space.isinstance_w(w_constant, space.w_int): if space.int_w(w_constant) <= 2: need_all_three_args = False _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit