[pypy-commit] pypy align_float_cast: merge default into branch
mattip
noreply at buildbot.pypy.org
Thu Feb 13 20:22:45 CET 2014
Author: Matti Picus <matti.picus at gmail.com>
Branch: align_float_cast
Changeset: r69133:cd30cf395ac4
Date: 2014-02-13 19:31 +0200
http://bitbucket.org/pypy/pypy/changeset/cd30cf395ac4/
Log: merge default into branch
diff too long, truncating to 2000 out of 36874 lines
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -28,7 +28,7 @@
DEALINGS IN THE SOFTWARE.
-PyPy Copyright holders 2003-2013
+PyPy Copyright holders 2003-2014
-----------------------------------
Except when otherwise stated (look for LICENSE files or information at
diff --git a/dotviewer/graphdisplay.py b/dotviewer/graphdisplay.py
--- a/dotviewer/graphdisplay.py
+++ b/dotviewer/graphdisplay.py
@@ -136,6 +136,7 @@
Click on objects to move around
Drag with the left mouse button to zoom in/out
Drag with the right mouse button to scroll
+ Use scroll wheel do scroll up or down
""".replace('\n ', '\n').strip() # poor man's dedent
@@ -613,6 +614,19 @@
def process_MouseButtonUp(self, event):
self.dragging = None
pygame.event.set_grab(False)
+ # handle directional scrolling
+ if event.button == 4:
+ self.pan((0, -1))
+ return
+ if event.button == 5:
+ self.pan((0, 1))
+ return
+ if event.button == 6:
+ self.pan((-1, 0))
+ return
+ if event.button == 7:
+ self.pan((1, 0))
+ return
if self.click_time is not None and abs(time.time() - self.click_time) < 1:
# click (no significant dragging)
self.notifyclick(self.click_origin)
diff --git a/include/PyPy.h b/include/PyPy.h
new file mode 100644
--- /dev/null
+++ b/include/PyPy.h
@@ -0,0 +1,54 @@
+#ifndef _PYPY_H_
+#define _PYPY_H_
+
+/* This header is meant to be included in programs that use PyPy as an
+ embedded library. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* You should call this first once. */
+void rpython_startup_code(void);
+
+
+/* Initialize the home directory of PyPy. It is necessary to call this.
+
+ Call it with "home" being the file name of the libpypy.so, for
+ example; it will be used as a starting point when searching for the
+ lib-python and lib_pypy directories. They are searched from
+ "home/..", "home/../..", etc. Returns 0 if everything was fine. If
+ an error occurs, returns 1 and (if verbose != 0) prints some
+ information to stderr.
+ */
+int pypy_setup_home(char *home, int verbose);
+
+
+/* If your program has multiple threads, then you need to call
+ pypy_init_threads() once at init time, and then pypy_thread_attach()
+ once in each other thread that just started and in which you want to
+ run Python code (including via callbacks, see below).
+ */
+void pypy_init_threads(void);
+void pypy_thread_attach(void);
+
+
+/* The main entry point: executes "source" as plain Python code.
+ Returns 0 if everything was fine. If a Python exception is
+ uncaught, it is printed to stderr and 1 is returned.
+
+ Usually, the Python code from "source" should use cffi to fill in
+ global variables of "function pointer" type in your program. Use
+ cffi callbacks to do so. Once it is done, there is no need to call
+ pypy_execute_source() any more: from C, you call directly the
+ functions (which are "callbacks" from the point of view of Python).
+ */
+int pypy_execute_source(char *source);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/lib-python/2.7/ctypes/__init__.py b/lib-python/2.7/ctypes/__init__.py
--- a/lib-python/2.7/ctypes/__init__.py
+++ b/lib-python/2.7/ctypes/__init__.py
@@ -371,10 +371,9 @@
self._handle = handle
def __repr__(self):
- return "<%s '%s', handle %r at %x>" % \
- (self.__class__.__name__, self._name,
- (self._handle),
- id(self) & (_sys.maxint*2 + 1))
+ return "<%s '%s', handle %r at 0x%x>" % (
+ self.__class__.__name__, self._name, self._handle,
+ id(self) & (_sys.maxint * 2 + 1))
def __getattr__(self, name):
diff --git a/lib-python/2.7/test/test_memoryview.py b/lib-python/2.7/test/test_memoryview.py
--- a/lib-python/2.7/test/test_memoryview.py
+++ b/lib-python/2.7/test/test_memoryview.py
@@ -166,11 +166,18 @@
self.assertTrue(m[0:6] == m[:])
self.assertFalse(m[0:5] == m)
- # Comparison with objects which don't support the buffer API
- self.assertFalse(m == u"abcdef")
- self.assertTrue(m != u"abcdef")
- self.assertFalse(u"abcdef" == m)
- self.assertTrue(u"abcdef" != m)
+ if test_support.check_impl_detail(cpython=True):
+ # what is supported and what is not supported by memoryview is
+ # very inconsisten on CPython. In PyPy, memoryview supports
+ # the buffer interface, and thus the following comparison
+ # succeeds. See also the comment in
+ # pypy.modules.__builtin__.interp_memoryview.W_MemoryView.descr_buffer
+ #
+ # Comparison with objects which don't support the buffer API
+ self.assertFalse(m == u"abcdef", "%s %s" % (self, tp))
+ self.assertTrue(m != u"abcdef")
+ self.assertFalse(u"abcdef" == m)
+ self.assertTrue(u"abcdef" != m)
# Unordered comparisons are unimplemented, and therefore give
# arbitrary results (they raise a TypeError in py3k)
diff --git a/lib-python/2.7/test/test_ssl.py b/lib-python/2.7/test/test_ssl.py
--- a/lib-python/2.7/test/test_ssl.py
+++ b/lib-python/2.7/test/test_ssl.py
@@ -993,7 +993,7 @@
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
diff --git a/lib-python/conftest.py b/lib-python/conftest.py
--- a/lib-python/conftest.py
+++ b/lib-python/conftest.py
@@ -109,7 +109,7 @@
RegrTest('test_asynchat.py', usemodules='select fcntl'),
RegrTest('test_asyncore.py', usemodules='select fcntl'),
RegrTest('test_atexit.py', core=True),
- RegrTest('test_audioop.py', skip="unsupported extension module"),
+ RegrTest('test_audioop.py', skip="incomplete module"),
RegrTest('test_augassign.py', core=True),
RegrTest('test_base64.py', usemodules='struct'),
RegrTest('test_bastion.py'),
diff --git a/lib_pypy/_ctypes/array.py b/lib_pypy/_ctypes/array.py
--- a/lib_pypy/_ctypes/array.py
+++ b/lib_pypy/_ctypes/array.py
@@ -1,4 +1,4 @@
-import _ffi
+from _rawffi import alt as _ffi
import _rawffi
from _ctypes.basics import _CData, cdata_from_address, _CDataMeta, sizeof
@@ -20,10 +20,13 @@
# we don't want to have buffers here
if len(val) > self._length_:
raise ValueError("%r too long" % (val,))
- for i in range(len(val)):
- self[i] = val[i]
+ if isinstance(val, str):
+ _rawffi.rawstring2charp(self._buffer.buffer, val)
+ else:
+ for i in range(len(val)):
+ self[i] = val[i]
if len(val) < self._length_:
- self[len(val)] = '\x00'
+ self._buffer[len(val)] = '\x00'
res.value = property(getvalue, setvalue)
def getraw(self):
@@ -33,8 +36,7 @@
def setraw(self, buffer):
if len(buffer) > self._length_:
raise ValueError("%r too long" % (buffer,))
- for i in range(len(buffer)):
- self[i] = buffer[i]
+ _rawffi.rawstring2charp(self._buffer.buffer, buffer)
res.raw = property(getraw, setraw)
elif subletter == 'u':
def getvalue(self):
@@ -45,10 +47,14 @@
# we don't want to have buffers here
if len(val) > self._length_:
raise ValueError("%r too long" % (val,))
+ if isinstance(val, unicode):
+ target = self._buffer
+ else:
+ target = self
for i in range(len(val)):
- self[i] = val[i]
+ target[i] = val[i]
if len(val) < self._length_:
- self[len(val)] = '\x00'
+ target[len(val)] = u'\x00'
res.value = property(getvalue, setvalue)
if '_length_' in typedict:
diff --git a/lib_pypy/_ctypes/basics.py b/lib_pypy/_ctypes/basics.py
--- a/lib_pypy/_ctypes/basics.py
+++ b/lib_pypy/_ctypes/basics.py
@@ -1,6 +1,6 @@
import _rawffi
-import _ffi
+from _rawffi import alt as _ffi
import sys
try: from __pypy__ import builtinify
diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -5,7 +5,7 @@
from _ctypes.basics import is_struct_shape
from _ctypes.builtin import get_errno, set_errno, get_last_error, set_last_error
import _rawffi
-import _ffi
+from _rawffi import alt as _ffi
import sys
import traceback
diff --git a/lib_pypy/_ctypes/pointer.py b/lib_pypy/_ctypes/pointer.py
--- a/lib_pypy/_ctypes/pointer.py
+++ b/lib_pypy/_ctypes/pointer.py
@@ -1,6 +1,6 @@
import _rawffi
-import _ffi
+from _rawffi import alt as _ffi
from _ctypes.basics import _CData, _CDataMeta, cdata_from_address, ArgumentError
from _ctypes.basics import keepalive_key, store_reference, ensure_objects
from _ctypes.basics import sizeof, byref, as_ffi_pointer
diff --git a/lib_pypy/_ctypes/primitive.py b/lib_pypy/_ctypes/primitive.py
--- a/lib_pypy/_ctypes/primitive.py
+++ b/lib_pypy/_ctypes/primitive.py
@@ -1,4 +1,4 @@
-import _ffi
+from _rawffi import alt as _ffi
import _rawffi
import weakref
import sys
diff --git a/lib_pypy/_ctypes/structure.py b/lib_pypy/_ctypes/structure.py
--- a/lib_pypy/_ctypes/structure.py
+++ b/lib_pypy/_ctypes/structure.py
@@ -2,6 +2,8 @@
import _rawffi
from _ctypes.basics import _CData, _CDataMeta, keepalive_key,\
store_reference, ensure_objects, CArgObject
+from _ctypes.array import Array
+from _ctypes.pointer import _Pointer
import inspect
def names_and_fields(self, _fields_, superclass, anonymous_fields=None):
@@ -104,8 +106,11 @@
def __set__(self, obj, value):
fieldtype = self.ctype
cobj = fieldtype.from_param(value)
- if ensure_objects(cobj) is not None:
- key = keepalive_key(self.num)
+ key = keepalive_key(self.num)
+ if issubclass(fieldtype, _Pointer) and isinstance(cobj, Array):
+ # if our value is an Array we need the whole thing alive
+ store_reference(obj, key, cobj)
+ elif ensure_objects(cobj) is not None:
store_reference(obj, key, cobj._objects)
arg = cobj._get_buffer_value()
if fieldtype._fficompositesize is not None:
diff --git a/lib_pypy/_ffi.py b/lib_pypy/_ffi.py
new file mode 100644
--- /dev/null
+++ b/lib_pypy/_ffi.py
@@ -0,0 +1,2 @@
+# Backward compatibility hack
+from _rawffi.alt import *
diff --git a/lib_pypy/_sha.py b/lib_pypy/_sha.py
--- a/lib_pypy/_sha.py
+++ b/lib_pypy/_sha.py
@@ -115,14 +115,14 @@
]
class sha:
- "An implementation of the MD5 hash function in pure Python."
+ "An implementation of the SHA hash function in pure Python."
digest_size = digestsize = 20
- block_size = 1
+ block_size = 512 // 8
def __init__(self):
"Initialisation."
-
+
# Initial message length in bits(!).
self.length = 0
self.count = [0, 0]
@@ -209,7 +209,7 @@
self.H2 = (self.H2 + C) & 0xffffffff
self.H3 = (self.H3 + D) & 0xffffffff
self.H4 = (self.H4 + E) & 0xffffffff
-
+
# Down from here all methods follow the Python Standard Library
# API of the sha module.
@@ -295,13 +295,13 @@
_long2bytesBigEndian(self.H3, 4) + \
_long2bytesBigEndian(self.H4, 4)
- self.H0 = H0
- self.H1 = H1
+ self.H0 = H0
+ self.H1 = H1
self.H2 = H2
self.H3 = H3
self.H4 = H4
- self.input = input
- self.count = count
+ self.input = input
+ self.count = count
return digest
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -330,6 +330,14 @@
# SQLite version information
sqlite_version = str(_ffi.string(_lib.sqlite3_libversion()).decode('ascii'))
+_STMT_TYPE_UPDATE = 0
+_STMT_TYPE_DELETE = 1
+_STMT_TYPE_INSERT = 2
+_STMT_TYPE_REPLACE = 3
+_STMT_TYPE_OTHER = 4
+_STMT_TYPE_SELECT = 5
+_STMT_TYPE_INVALID = 6
+
class Error(StandardError):
pass
@@ -992,13 +1000,18 @@
self.__statement = self.__connection._statement_cache.get(sql)
if self.__connection._isolation_level is not None:
- if self.__statement._type in ("UPDATE", "DELETE", "INSERT", "REPLACE"):
+ if self.__statement._type in (
+ _STMT_TYPE_UPDATE,
+ _STMT_TYPE_DELETE,
+ _STMT_TYPE_INSERT,
+ _STMT_TYPE_REPLACE
+ ):
if not self.__connection._in_transaction:
self.__connection._begin()
- elif self.__statement._type == "OTHER":
+ elif self.__statement._type == _STMT_TYPE_OTHER:
if self.__connection._in_transaction:
self.__connection.commit()
- elif self.__statement._type == "SELECT":
+ elif self.__statement._type == _STMT_TYPE_SELECT:
if multiple:
raise ProgrammingError("You cannot execute SELECT "
"statements in executemany().")
@@ -1021,12 +1034,17 @@
self.__statement._reset()
raise self.__connection._get_exception(ret)
- if self.__statement._type in ("UPDATE", "DELETE", "INSERT", "REPLACE"):
+ if self.__statement._type in (
+ _STMT_TYPE_UPDATE,
+ _STMT_TYPE_DELETE,
+ _STMT_TYPE_INSERT,
+ _STMT_TYPE_REPLACE
+ ):
if self.__rowcount == -1:
self.__rowcount = 0
self.__rowcount += _lib.sqlite3_changes(self.__connection._db)
- if not multiple and self.__statement._type == "INSERT":
+ if not multiple and self.__statement._type == _STMT_TYPE_INSERT:
self.__lastrowid = _lib.sqlite3_last_insert_rowid(self.__connection._db)
else:
self.__lastrowid = None
@@ -1176,11 +1194,19 @@
first_word = sql.lstrip().split(" ")[0].upper()
if first_word == "":
- self._type = "INVALID"
- elif first_word in ("SELECT", "INSERT", "UPDATE", "DELETE", "REPLACE"):
- self._type = first_word
+ self._type = _STMT_TYPE_INVALID
+ elif first_word == "SELECT":
+ self._type = _STMT_TYPE_SELECT
+ elif first_word == "INSERT":
+ self._type = _STMT_TYPE_INSERT
+ elif first_word == "UPDATE":
+ self._type = _STMT_TYPE_UPDATE
+ elif first_word == "DELETE":
+ self._type = _STMT_TYPE_DELETE
+ elif first_word == "REPLACE":
+ self._type = _STMT_TYPE_REPLACE
else:
- self._type = "OTHER"
+ self._type = _STMT_TYPE_OTHER
if isinstance(sql, unicode):
sql = sql.encode('utf-8')
@@ -1193,7 +1219,7 @@
if ret == _lib.SQLITE_OK and not self._statement:
# an empty statement, work around that, as it's the least trouble
- self._type = "SELECT"
+ self._type = _STMT_TYPE_SELECT
c_sql = _ffi.new("char[]", b"select 42")
ret = _lib.sqlite3_prepare_v2(self.__con._db, c_sql, -1,
statement_star, next_char)
@@ -1312,7 +1338,12 @@
raise ValueError("parameters are of unsupported type")
def _get_description(self):
- if self._type in ("INSERT", "UPDATE", "DELETE", "REPLACE"):
+ if self._type in (
+ _STMT_TYPE_INSERT,
+ _STMT_TYPE_UPDATE,
+ _STMT_TYPE_DELETE,
+ _STMT_TYPE_REPLACE
+ ):
return None
desc = []
for i in xrange(_lib.sqlite3_column_count(self._statement)):
diff --git a/lib_pypy/audioop.py b/lib_pypy/audioop.py
new file mode 100644
--- /dev/null
+++ b/lib_pypy/audioop.py
@@ -0,0 +1,29 @@
+
+import struct
+
+
+class error(Exception):
+ pass
+
+
+def _check_size(size):
+ if size != 1 and size != 2 and size != 4:
+ raise error("Size should be 1, 2 or 4")
+
+
+def _check_params(length, size):
+ _check_size(size)
+ if length % size != 0:
+ raise error("not a whole number of frames")
+
+
+def getsample(cp, size, i):
+ _check_params(len(cp), size)
+ if not (0 <= i < len(cp) / size):
+ raise error("Index out of range")
+ if size == 1:
+ return struct.unpack_from("B", buffer(cp)[i:])[0]
+ elif size == 2:
+ return struct.unpack_from("H", buffer(cp)[i * 2:])[0]
+ elif size == 4:
+ return struct.unpack_from("I", buffer(cp)[i * 4:])[0]
diff --git a/lib_pypy/datetime.py b/lib_pypy/datetime.py
--- a/lib_pypy/datetime.py
+++ b/lib_pypy/datetime.py
@@ -878,7 +878,6 @@
month = self._month
if day is None:
day = self._day
- year, month, day = _check_date_fields(year, month, day)
return date(year, month, day)
# Comparisons of date objects with other.
@@ -1389,8 +1388,6 @@
microsecond = self.microsecond
if tzinfo is True:
tzinfo = self.tzinfo
- hour, minute, second, microsecond = _check_time_fields(hour, minute, second, microsecond)
- _check_tzinfo_arg(tzinfo)
return time(hour, minute, second, microsecond, tzinfo)
def __nonzero__(self):
@@ -1608,9 +1605,6 @@
microsecond = self.microsecond
if tzinfo is True:
tzinfo = self.tzinfo
- year, month, day = _check_date_fields(year, month, day)
- hour, minute, second, microsecond = _check_time_fields(hour, minute, second, microsecond)
- _check_tzinfo_arg(tzinfo)
return datetime(year, month, day, hour, minute, second, microsecond,
tzinfo)
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -34,14 +34,14 @@
"struct", "_hashlib", "_md5", "_sha", "_minimal_curses", "cStringIO",
"thread", "itertools", "pyexpat", "_ssl", "cpyext", "array",
"binascii", "_multiprocessing", '_warnings',
- "_collections", "_multibytecodec", "micronumpy", "_ffi",
+ "_collections", "_multibytecodec", "micronumpy",
"_continuation", "_cffi_backend", "_csv", "cppyy", "_pypyjson"]
))
translation_modules = default_modules.copy()
translation_modules.update(dict.fromkeys(
["fcntl", "rctime", "select", "signal", "_rawffi", "zlib",
- "struct", "_md5", "cStringIO", "array", "_ffi",
+ "struct", "_md5", "cStringIO", "array",
"binascii",
# the following are needed for pyrepl (and hence for the
# interactive prompt/pdb)
@@ -96,7 +96,6 @@
# no _rawffi if importing rpython.rlib.clibffi raises ImportError
# or CompilationError or py.test.skip.Exception
"_rawffi" : ["rpython.rlib.clibffi"],
- "_ffi" : ["rpython.rlib.clibffi"],
"zlib" : ["rpython.rlib.rzlib"],
"bz2" : ["pypy.module.bz2.interp_bz2"],
diff --git a/pypy/doc/_ref.txt b/pypy/doc/_ref.txt
--- a/pypy/doc/_ref.txt
+++ b/pypy/doc/_ref.txt
@@ -109,6 +109,4 @@
.. _`rpython/translator/c/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/c/
.. _`rpython/translator/c/src/stacklet/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/c/src/stacklet/
.. _`rpython/translator/c/src/stacklet/stacklet.h`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/c/src/stacklet/stacklet.h
-.. _`rpython/translator/cli/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/cli/
-.. _`rpython/translator/jvm/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/jvm/
.. _`rpython/translator/tool/`: https://bitbucket.org/pypy/pypy/src/default/rpython/translator/tool/
diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -38,7 +38,7 @@
# General information about the project.
project = u'PyPy'
-copyright = u'2013, The PyPy Project'
+copyright = u'2014, The PyPy Project'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/pypy/doc/config/translation.lldebug0.txt b/pypy/doc/config/translation.lldebug0.txt
new file mode 100644
--- /dev/null
+++ b/pypy/doc/config/translation.lldebug0.txt
@@ -0,0 +1,1 @@
+Like lldebug, but in addition compile C files with -O0
diff --git a/pypy/doc/faq.rst b/pypy/doc/faq.rst
--- a/pypy/doc/faq.rst
+++ b/pypy/doc/faq.rst
@@ -103,8 +103,7 @@
.. _`extension modules`: cpython_differences.html#extension-modules
.. _`cpython differences`: cpython_differences.html
-.. _`compatibility wiki`:
-.. https://bitbucket.org/pypy/compatibility/wiki/Home
+.. _`compatibility wiki`: https://bitbucket.org/pypy/compatibility/wiki/Home
.. _cffi: http://cffi.readthedocs.org/
---------------------------------
@@ -426,25 +425,12 @@
Could we use LLVM?
------------------
-In theory yes. But we tried to use it 5 or 6 times already, as a
-translation backend or as a JIT backend --- and failed each time.
+There is a (static) translation backend using LLVM in the branch
+``llvm-translation-backend``. It can translate PyPy with or without the JIT on
+Linux.
-In more details: using LLVM as a (static) translation backend is
-pointless nowadays because you can generate C code and compile it with
-clang. (Note that compiling PyPy with clang gives a result that is not
-faster than compiling it with gcc.) We might in theory get extra
-benefits from LLVM's GC integration, but this requires more work on the
-LLVM side before it would be remotely useful. Anyway, it could be
-interfaced via a custom primitive in the C code.
-
-On the other hand, using LLVM as our JIT backend looks interesting as
-well --- but again we made an attempt, and it failed: LLVM has no way to
-patch the generated machine code.
-
-So the position of the core PyPy developers is that if anyone wants to
-make an N+1'th attempt with LLVM, they are welcome, and will be happy to
-provide help in the IRC channel, but they are left with the burden of proof
-that (a) it works and (b) it gives important benefits.
+Using LLVM as our JIT backend looks interesting as well -- we made an attempt,
+but it failed: LLVM has no way to patch the generated machine code.
----------------------
How do I compile PyPy?
diff --git a/pypy/doc/garbage_collection.rst b/pypy/doc/garbage_collection.rst
--- a/pypy/doc/garbage_collection.rst
+++ b/pypy/doc/garbage_collection.rst
@@ -210,4 +210,12 @@
are preserved. If the object dies then the pre-reserved location
becomes free garbage, to be collected at the next major collection.
+The exact name of this GC is either `minimark` or `incminimark`. The
+latter is a version that does major collections incrementally (i.e. one
+major collection is split along some number of minor collections, rather
+than being done all at once after a specific minor collection). The
+default is `incminimark`, as it seems to have a very minimal impact on
+performance and memory usage at the benefit of avoiding the long pauses
+of `minimark`.
+
.. include:: _ref.txt
diff --git a/pypy/doc/gc_info.rst b/pypy/doc/gc_info.rst
--- a/pypy/doc/gc_info.rst
+++ b/pypy/doc/gc_info.rst
@@ -6,7 +6,7 @@
Minimark
--------
-PyPy's default ``minimark`` garbage collector is configurable through
+PyPy's default ``incminimark`` garbage collector is configurable through
several environment variables:
``PYPY_GC_NURSERY``
@@ -14,6 +14,17 @@
Defaults to 1/2 of your cache or ``4M``.
Small values (like 1 or 1KB) are useful for debugging.
+``PYPY_GC_NURSERY_CLEANUP``
+ The interval at which nursery is cleaned up. Must
+ be smaller than the nursery size and bigger than the
+ biggest object we can allotate in the nursery.
+
+``PYPY_GC_INCREMENT_STEP``
+ The size of memory marked during the marking step. Default is size of
+ nursery times 2. If you mark it too high your GC is not incremental at
+ all. The minimum is set to size that survives minor collection times
+ 1.5 so we reclaim anything all the time.
+
``PYPY_GC_MAJOR_COLLECT``
Major collection memory factor.
Default is ``1.82``, which means trigger a major collection when the
diff --git a/pypy/doc/project-ideas.rst b/pypy/doc/project-ideas.rst
--- a/pypy/doc/project-ideas.rst
+++ b/pypy/doc/project-ideas.rst
@@ -74,6 +74,10 @@
The actual details would be rather differen in PyPy, but we would like to have
the same optimization implemented.
+Or maybe not. We can also play around with the idea of using a single
+representation: as a byte string in utf-8. (This idea needs some extra logic
+for efficient indexing, like a cache.)
+
.. _`optimized unicode representation`: http://www.python.org/dev/peps/pep-0393/
Translation Toolchain
@@ -138,20 +142,6 @@
* `hg`
-Experiment (again) with LLVM backend for RPython compilation
-------------------------------------------------------------
-
-We already tried working with LLVM and at the time, LLVM was not mature enough
-for our needs. It's possible that this has changed, reviving the LLVM backend
-(or writing new from scratch) for static compilation would be a good project.
-
-(On the other hand, just generating C code and using clang might be enough.
-The issue with that is the so-called "asmgcc GC root finder", which has tons
-of issues of this own. In my opinion (arigo), it would be definitely a
-better project to try to optimize the alternative, the "shadowstack" GC root
-finder, which is nicely portable. So far it gives a pypy that is around
-7% slower.)
-
Embedding PyPy
----------------------------------------
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -39,3 +39,31 @@
.. branch: OlivierBlanvillain/fix-3-broken-links-on-pypy-published-pap-1386250839215
Fix 3 broken links on PyPy published papers in docs.
+
+.. branch: jit-ordereddict
+
+.. branch: refactor-str-types
+Remove multimethods on str/unicode/bytearray and make the implementations share code.
+
+.. branch: remove-del-from-generatoriterator
+Speed up generators that don't yield inside try or wait blocks by skipping
+unnecessary cleanup.
+
+.. branch: annotator
+Remove FlowObjSpace.
+Improve cohesion between rpython.flowspace and rpython.annotator.
+
+.. branch: detect-immutable-fields
+mapdicts keep track of whether or not an attribute is every assigned to
+multiple times. If it's only assigned once then an elidable lookup is used when
+possible.
+
+.. branch: precompiled-headers
+Create a Makefile using precompiled headers for MSVC platforms.
+The downside is a messy nmake-compatible Makefile. Since gcc shows minimal
+speedup, it was not implemented.
+
+.. branch: camelot
+With a properly configured 256-color terminal (TERM=...-256color), the
+Mandelbrot set shown during translation now uses a range of 50 colours.
+Essential!
diff --git a/pypy/goal/getnightly.py b/pypy/goal/getnightly.py
--- a/pypy/goal/getnightly.py
+++ b/pypy/goal/getnightly.py
@@ -26,7 +26,12 @@
if branch == 'default':
branch = 'trunk'
-filename = 'pypy-c-jit-latest-%s.tar.bz2' % arch
+if '--nojit' in sys.argv:
+ kind = 'nojit'
+else:
+ kind = 'jit'
+
+filename = 'pypy-c-%s-latest-%s.tar.bz2' % (kind, arch)
url = 'http://buildbot.pypy.org/nightly/%s/%s' % (branch, filename)
tmp = py.path.local.mkdtemp()
mydir = tmp.chdir()
diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -90,9 +90,10 @@
return f
""")
- @entrypoint('main', [rffi.CCHARP, lltype.Signed], c_name='pypy_setup_home')
+ @entrypoint('main', [rffi.CCHARP, rffi.INT], c_name='pypy_setup_home')
def pypy_setup_home(ll_home, verbose):
from pypy.module.sys.initpath import pypy_find_stdlib
+ verbose = rffi.cast(lltype.Signed, verbose)
if ll_home:
home = rffi.charp2str(ll_home)
else:
@@ -120,7 +121,8 @@
@entrypoint('main', [rffi.CCHARP], c_name='pypy_execute_source')
def pypy_execute_source(ll_source):
source = rffi.charp2str(ll_source)
- return _pypy_execute_source(source)
+ res = _pypy_execute_source(source)
+ return rffi.cast(rffi.INT, res)
@entrypoint('main', [], c_name='pypy_init_threads')
def pypy_init_threads():
diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py
--- a/pypy/interpreter/argument.py
+++ b/pypy/interpreter/argument.py
@@ -1,11 +1,11 @@
"""
Arguments objects.
"""
-
-from pypy.interpreter.error import OperationError, operationerrfmt
from rpython.rlib.debug import make_sure_not_resized
from rpython.rlib import jit
+from pypy.interpreter.error import OperationError, oefmt
+
class Arguments(object):
"""
@@ -86,9 +86,9 @@
args_w = space.fixedview(w_stararg)
except OperationError, e:
if e.match(space, space.w_TypeError):
- raise operationerrfmt(
- space.w_TypeError,
- "argument after * must be a sequence, not %T", w_stararg)
+ raise oefmt(space.w_TypeError,
+ "argument after * must be a sequence, not %T",
+ w_stararg)
raise
self.arguments_w = self.arguments_w + args_w
@@ -113,10 +113,9 @@
w_keys = space.call_method(w_starstararg, "keys")
except OperationError, e:
if e.match(space, space.w_AttributeError):
- raise operationerrfmt(
- space.w_TypeError,
- "argument after ** must be a mapping, not %T",
- w_starstararg)
+ raise oefmt(space.w_TypeError,
+ "argument after ** must be a mapping, not %T",
+ w_starstararg)
raise
keys_w = space.unpackiterable(w_keys)
keywords_w = [None] * len(keys_w)
@@ -281,8 +280,7 @@
self._match_signature(w_firstarg,
scope_w, signature, defaults_w, 0)
except ArgErr, e:
- raise operationerrfmt(self.space.w_TypeError,
- "%s() %s", fnname, e.getmsg())
+ raise oefmt(self.space.w_TypeError, "%s() %s", fnname, e.getmsg())
return signature.scope_length()
def _parse(self, w_firstarg, signature, defaults_w, blindargs=0):
@@ -304,8 +302,7 @@
try:
return self._parse(w_firstarg, signature, defaults_w, blindargs)
except ArgErr, e:
- raise operationerrfmt(self.space.w_TypeError,
- "%s() %s", fnname, e.getmsg())
+ raise oefmt(self.space.w_TypeError, "%s() %s", fnname, e.getmsg())
@staticmethod
def frompacked(space, w_args=None, w_kwds=None):
@@ -344,10 +341,9 @@
for key in keywords:
for otherkey in existingkeywords:
if otherkey == key:
- raise operationerrfmt(space.w_TypeError,
- "got multiple values "
- "for keyword argument "
- "'%s'", key)
+ raise oefmt(space.w_TypeError,
+ "got multiple values for keyword argument '%s'",
+ key)
def _do_combine_starstarargs_wrapped(space, keys_w, w_starstararg, keywords,
keywords_w, existingkeywords):
@@ -367,10 +363,9 @@
raise
else:
if existingkeywords and key in existingkeywords:
- raise operationerrfmt(space.w_TypeError,
- "got multiple values "
- "for keyword argument "
- "'%s'", key)
+ raise oefmt(space.w_TypeError,
+ "got multiple values for keyword argument '%s'",
+ key)
keywords[i] = key
keywords_w[i] = space.getitem(w_starstararg, w_key)
i += 1
diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -1,12 +1,18 @@
# Generated by tools/asdl_py.py
-from pypy.interpreter.baseobjspace import W_Root
-from pypy.interpreter import typedef
-from pypy.interpreter.gateway import interp2app
-from pypy.interpreter.error import OperationError, operationerrfmt
from rpython.rlib.unroll import unrolling_iterable
from rpython.tool.pairtype import extendabletype
from rpython.tool.sourcetools import func_with_new_name
+from pypy.interpreter import typedef
+from pypy.interpreter.baseobjspace import W_Root
+from pypy.interpreter.error import OperationError, oefmt
+from pypy.interpreter.gateway import interp2app
+
+
+def raise_attriberr(space, w_obj, name):
+ raise oefmt(space.w_AttributeError,
+ "'%T' object has no attribute '%s'", w_obj, name)
+
def check_string(space, w_obj):
if not (space.isinstance_w(w_obj, space.w_str) or
@@ -70,11 +76,13 @@
continue # field is optional
w_obj = self.getdictvalue(space, missing)
if w_obj is None:
- err = "required field \"%s\" missing from %s"
- raise operationerrfmt(space.w_TypeError, err, missing, host)
+ raise oefmt(space.w_TypeError,
+ "required field \"%s\" missing from %s",
+ missing, host)
else:
- err = "incorrect type for field \"%s\" in %s"
- raise operationerrfmt(space.w_TypeError, err, missing, host)
+ raise oefmt(space.w_TypeError,
+ "incorrect type for field \"%s\" in %s",
+ missing, host)
raise AssertionError("should not reach here")
@@ -2793,7 +2801,7 @@
def Module_get_body(space, w_self):
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -2834,7 +2842,7 @@
def Interactive_get_body(space, w_self):
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -2879,7 +2887,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
return space.wrap(w_self.body)
def Expression_set_body(space, w_self, w_new_value):
@@ -2922,7 +2930,7 @@
def Suite_get_body(space, w_self):
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -2967,7 +2975,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'lineno')
+ raise_attriberr(space, w_self, 'lineno')
return space.wrap(w_self.lineno)
def stmt_set_lineno(space, w_self, w_new_value):
@@ -2988,7 +2996,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 2:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'col_offset')
+ raise_attriberr(space, w_self, 'col_offset')
return space.wrap(w_self.col_offset)
def stmt_set_col_offset(space, w_self, w_new_value):
@@ -3018,7 +3026,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'name')
+ raise_attriberr(space, w_self, 'name')
return space.wrap(w_self.name)
def FunctionDef_set_name(space, w_self, w_new_value):
@@ -3039,7 +3047,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'args')
+ raise_attriberr(space, w_self, 'args')
return space.wrap(w_self.args)
def FunctionDef_set_args(space, w_self, w_new_value):
@@ -3056,7 +3064,7 @@
def FunctionDef_get_body(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -3072,7 +3080,7 @@
def FunctionDef_get_decorator_list(space, w_self):
if not w_self.initialization_state & 32:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'decorator_list')
+ raise_attriberr(space, w_self, 'decorator_list')
if w_self.w_decorator_list is None:
if w_self.decorator_list is None:
list_w = []
@@ -3121,7 +3129,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'name')
+ raise_attriberr(space, w_self, 'name')
return space.wrap(w_self.name)
def ClassDef_set_name(space, w_self, w_new_value):
@@ -3138,7 +3146,7 @@
def ClassDef_get_bases(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'bases')
+ raise_attriberr(space, w_self, 'bases')
if w_self.w_bases is None:
if w_self.bases is None:
list_w = []
@@ -3154,7 +3162,7 @@
def ClassDef_get_body(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -3170,7 +3178,7 @@
def ClassDef_get_decorator_list(space, w_self):
if not w_self.initialization_state & 32:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'decorator_list')
+ raise_attriberr(space, w_self, 'decorator_list')
if w_self.w_decorator_list is None:
if w_self.decorator_list is None:
list_w = []
@@ -3220,7 +3228,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Return_set_value(space, w_self, w_new_value):
@@ -3263,7 +3271,7 @@
def Delete_get_targets(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'targets')
+ raise_attriberr(space, w_self, 'targets')
if w_self.w_targets is None:
if w_self.targets is None:
list_w = []
@@ -3304,7 +3312,7 @@
def Assign_get_targets(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'targets')
+ raise_attriberr(space, w_self, 'targets')
if w_self.w_targets is None:
if w_self.targets is None:
list_w = []
@@ -3324,7 +3332,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Assign_set_value(space, w_self, w_new_value):
@@ -3373,7 +3381,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'target')
+ raise_attriberr(space, w_self, 'target')
return space.wrap(w_self.target)
def AugAssign_set_target(space, w_self, w_new_value):
@@ -3396,7 +3404,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'op')
+ raise_attriberr(space, w_self, 'op')
return operator_to_class[w_self.op - 1]()
def AugAssign_set_op(space, w_self, w_new_value):
@@ -3419,7 +3427,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def AugAssign_set_value(space, w_self, w_new_value):
@@ -3468,7 +3476,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'dest')
+ raise_attriberr(space, w_self, 'dest')
return space.wrap(w_self.dest)
def Print_set_dest(space, w_self, w_new_value):
@@ -3487,7 +3495,7 @@
def Print_get_values(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'values')
+ raise_attriberr(space, w_self, 'values')
if w_self.w_values is None:
if w_self.values is None:
list_w = []
@@ -3507,7 +3515,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'nl')
+ raise_attriberr(space, w_self, 'nl')
return space.wrap(w_self.nl)
def Print_set_nl(space, w_self, w_new_value):
@@ -3555,7 +3563,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'target')
+ raise_attriberr(space, w_self, 'target')
return space.wrap(w_self.target)
def For_set_target(space, w_self, w_new_value):
@@ -3578,7 +3586,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'iter')
+ raise_attriberr(space, w_self, 'iter')
return space.wrap(w_self.iter)
def For_set_iter(space, w_self, w_new_value):
@@ -3597,7 +3605,7 @@
def For_get_body(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -3613,7 +3621,7 @@
def For_get_orelse(space, w_self):
if not w_self.initialization_state & 32:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'orelse')
+ raise_attriberr(space, w_self, 'orelse')
if w_self.w_orelse is None:
if w_self.orelse is None:
list_w = []
@@ -3662,7 +3670,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'test')
+ raise_attriberr(space, w_self, 'test')
return space.wrap(w_self.test)
def While_set_test(space, w_self, w_new_value):
@@ -3681,7 +3689,7 @@
def While_get_body(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -3697,7 +3705,7 @@
def While_get_orelse(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'orelse')
+ raise_attriberr(space, w_self, 'orelse')
if w_self.w_orelse is None:
if w_self.orelse is None:
list_w = []
@@ -3745,7 +3753,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'test')
+ raise_attriberr(space, w_self, 'test')
return space.wrap(w_self.test)
def If_set_test(space, w_self, w_new_value):
@@ -3764,7 +3772,7 @@
def If_get_body(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -3780,7 +3788,7 @@
def If_get_orelse(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'orelse')
+ raise_attriberr(space, w_self, 'orelse')
if w_self.w_orelse is None:
if w_self.orelse is None:
list_w = []
@@ -3828,7 +3836,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'context_expr')
+ raise_attriberr(space, w_self, 'context_expr')
return space.wrap(w_self.context_expr)
def With_set_context_expr(space, w_self, w_new_value):
@@ -3851,7 +3859,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'optional_vars')
+ raise_attriberr(space, w_self, 'optional_vars')
return space.wrap(w_self.optional_vars)
def With_set_optional_vars(space, w_self, w_new_value):
@@ -3870,7 +3878,7 @@
def With_get_body(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -3917,7 +3925,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'type')
+ raise_attriberr(space, w_self, 'type')
return space.wrap(w_self.type)
def Raise_set_type(space, w_self, w_new_value):
@@ -3940,7 +3948,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'inst')
+ raise_attriberr(space, w_self, 'inst')
return space.wrap(w_self.inst)
def Raise_set_inst(space, w_self, w_new_value):
@@ -3963,7 +3971,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'tback')
+ raise_attriberr(space, w_self, 'tback')
return space.wrap(w_self.tback)
def Raise_set_tback(space, w_self, w_new_value):
@@ -4008,7 +4016,7 @@
def TryExcept_get_body(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -4024,7 +4032,7 @@
def TryExcept_get_handlers(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'handlers')
+ raise_attriberr(space, w_self, 'handlers')
if w_self.w_handlers is None:
if w_self.handlers is None:
list_w = []
@@ -4040,7 +4048,7 @@
def TryExcept_get_orelse(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'orelse')
+ raise_attriberr(space, w_self, 'orelse')
if w_self.w_orelse is None:
if w_self.orelse is None:
list_w = []
@@ -4085,7 +4093,7 @@
def TryFinally_get_body(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -4101,7 +4109,7 @@
def TryFinally_get_finalbody(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'finalbody')
+ raise_attriberr(space, w_self, 'finalbody')
if w_self.w_finalbody is None:
if w_self.finalbody is None:
list_w = []
@@ -4148,7 +4156,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'test')
+ raise_attriberr(space, w_self, 'test')
return space.wrap(w_self.test)
def Assert_set_test(space, w_self, w_new_value):
@@ -4171,7 +4179,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'msg')
+ raise_attriberr(space, w_self, 'msg')
return space.wrap(w_self.msg)
def Assert_set_msg(space, w_self, w_new_value):
@@ -4215,7 +4223,7 @@
def Import_get_names(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'names')
+ raise_attriberr(space, w_self, 'names')
if w_self.w_names is None:
if w_self.names is None:
list_w = []
@@ -4260,7 +4268,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'module')
+ raise_attriberr(space, w_self, 'module')
return space.wrap(w_self.module)
def ImportFrom_set_module(space, w_self, w_new_value):
@@ -4280,7 +4288,7 @@
def ImportFrom_get_names(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'names')
+ raise_attriberr(space, w_self, 'names')
if w_self.w_names is None:
if w_self.names is None:
list_w = []
@@ -4300,7 +4308,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'level')
+ raise_attriberr(space, w_self, 'level')
return space.wrap(w_self.level)
def ImportFrom_set_level(space, w_self, w_new_value):
@@ -4348,7 +4356,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
return space.wrap(w_self.body)
def Exec_set_body(space, w_self, w_new_value):
@@ -4371,7 +4379,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'globals')
+ raise_attriberr(space, w_self, 'globals')
return space.wrap(w_self.globals)
def Exec_set_globals(space, w_self, w_new_value):
@@ -4394,7 +4402,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'locals')
+ raise_attriberr(space, w_self, 'locals')
return space.wrap(w_self.locals)
def Exec_set_locals(space, w_self, w_new_value):
@@ -4439,7 +4447,7 @@
def Global_get_names(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'names')
+ raise_attriberr(space, w_self, 'names')
if w_self.w_names is None:
if w_self.names is None:
list_w = []
@@ -4484,7 +4492,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Expr_set_value(space, w_self, w_new_value):
@@ -4582,7 +4590,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'lineno')
+ raise_attriberr(space, w_self, 'lineno')
return space.wrap(w_self.lineno)
def expr_set_lineno(space, w_self, w_new_value):
@@ -4603,7 +4611,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 2:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'col_offset')
+ raise_attriberr(space, w_self, 'col_offset')
return space.wrap(w_self.col_offset)
def expr_set_col_offset(space, w_self, w_new_value):
@@ -4633,7 +4641,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'op')
+ raise_attriberr(space, w_self, 'op')
return boolop_to_class[w_self.op - 1]()
def BoolOp_set_op(space, w_self, w_new_value):
@@ -4652,7 +4660,7 @@
def BoolOp_get_values(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'values')
+ raise_attriberr(space, w_self, 'values')
if w_self.w_values is None:
if w_self.values is None:
list_w = []
@@ -4698,7 +4706,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'left')
+ raise_attriberr(space, w_self, 'left')
return space.wrap(w_self.left)
def BinOp_set_left(space, w_self, w_new_value):
@@ -4721,7 +4729,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'op')
+ raise_attriberr(space, w_self, 'op')
return operator_to_class[w_self.op - 1]()
def BinOp_set_op(space, w_self, w_new_value):
@@ -4744,7 +4752,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'right')
+ raise_attriberr(space, w_self, 'right')
return space.wrap(w_self.right)
def BinOp_set_right(space, w_self, w_new_value):
@@ -4793,7 +4801,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'op')
+ raise_attriberr(space, w_self, 'op')
return unaryop_to_class[w_self.op - 1]()
def UnaryOp_set_op(space, w_self, w_new_value):
@@ -4816,7 +4824,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'operand')
+ raise_attriberr(space, w_self, 'operand')
return space.wrap(w_self.operand)
def UnaryOp_set_operand(space, w_self, w_new_value):
@@ -4864,7 +4872,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'args')
+ raise_attriberr(space, w_self, 'args')
return space.wrap(w_self.args)
def Lambda_set_args(space, w_self, w_new_value):
@@ -4885,7 +4893,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
return space.wrap(w_self.body)
def Lambda_set_body(space, w_self, w_new_value):
@@ -4933,7 +4941,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'test')
+ raise_attriberr(space, w_self, 'test')
return space.wrap(w_self.test)
def IfExp_set_test(space, w_self, w_new_value):
@@ -4956,7 +4964,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
return space.wrap(w_self.body)
def IfExp_set_body(space, w_self, w_new_value):
@@ -4979,7 +4987,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'orelse')
+ raise_attriberr(space, w_self, 'orelse')
return space.wrap(w_self.orelse)
def IfExp_set_orelse(space, w_self, w_new_value):
@@ -5024,7 +5032,7 @@
def Dict_get_keys(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'keys')
+ raise_attriberr(space, w_self, 'keys')
if w_self.w_keys is None:
if w_self.keys is None:
list_w = []
@@ -5040,7 +5048,7 @@
def Dict_get_values(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'values')
+ raise_attriberr(space, w_self, 'values')
if w_self.w_values is None:
if w_self.values is None:
list_w = []
@@ -5083,7 +5091,7 @@
def Set_get_elts(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'elts')
+ raise_attriberr(space, w_self, 'elts')
if w_self.w_elts is None:
if w_self.elts is None:
list_w = []
@@ -5128,7 +5136,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'elt')
+ raise_attriberr(space, w_self, 'elt')
return space.wrap(w_self.elt)
def ListComp_set_elt(space, w_self, w_new_value):
@@ -5147,7 +5155,7 @@
def ListComp_get_generators(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'generators')
+ raise_attriberr(space, w_self, 'generators')
if w_self.w_generators is None:
if w_self.generators is None:
list_w = []
@@ -5193,7 +5201,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'elt')
+ raise_attriberr(space, w_self, 'elt')
return space.wrap(w_self.elt)
def SetComp_set_elt(space, w_self, w_new_value):
@@ -5212,7 +5220,7 @@
def SetComp_get_generators(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'generators')
+ raise_attriberr(space, w_self, 'generators')
if w_self.w_generators is None:
if w_self.generators is None:
list_w = []
@@ -5258,7 +5266,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'key')
+ raise_attriberr(space, w_self, 'key')
return space.wrap(w_self.key)
def DictComp_set_key(space, w_self, w_new_value):
@@ -5281,7 +5289,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def DictComp_set_value(space, w_self, w_new_value):
@@ -5300,7 +5308,7 @@
def DictComp_get_generators(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'generators')
+ raise_attriberr(space, w_self, 'generators')
if w_self.w_generators is None:
if w_self.generators is None:
list_w = []
@@ -5347,7 +5355,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'elt')
+ raise_attriberr(space, w_self, 'elt')
return space.wrap(w_self.elt)
def GeneratorExp_set_elt(space, w_self, w_new_value):
@@ -5366,7 +5374,7 @@
def GeneratorExp_get_generators(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'generators')
+ raise_attriberr(space, w_self, 'generators')
if w_self.w_generators is None:
if w_self.generators is None:
list_w = []
@@ -5412,7 +5420,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Yield_set_value(space, w_self, w_new_value):
@@ -5459,7 +5467,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'left')
+ raise_attriberr(space, w_self, 'left')
return space.wrap(w_self.left)
def Compare_set_left(space, w_self, w_new_value):
@@ -5478,7 +5486,7 @@
def Compare_get_ops(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ops')
+ raise_attriberr(space, w_self, 'ops')
if w_self.w_ops is None:
if w_self.ops is None:
list_w = []
@@ -5494,7 +5502,7 @@
def Compare_get_comparators(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'comparators')
+ raise_attriberr(space, w_self, 'comparators')
if w_self.w_comparators is None:
if w_self.comparators is None:
list_w = []
@@ -5542,7 +5550,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'func')
+ raise_attriberr(space, w_self, 'func')
return space.wrap(w_self.func)
def Call_set_func(space, w_self, w_new_value):
@@ -5561,7 +5569,7 @@
def Call_get_args(space, w_self):
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'args')
+ raise_attriberr(space, w_self, 'args')
if w_self.w_args is None:
if w_self.args is None:
list_w = []
@@ -5577,7 +5585,7 @@
def Call_get_keywords(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'keywords')
+ raise_attriberr(space, w_self, 'keywords')
if w_self.w_keywords is None:
if w_self.keywords is None:
list_w = []
@@ -5597,7 +5605,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 32:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'starargs')
+ raise_attriberr(space, w_self, 'starargs')
return space.wrap(w_self.starargs)
def Call_set_starargs(space, w_self, w_new_value):
@@ -5620,7 +5628,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 64:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'kwargs')
+ raise_attriberr(space, w_self, 'kwargs')
return space.wrap(w_self.kwargs)
def Call_set_kwargs(space, w_self, w_new_value):
@@ -5673,7 +5681,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Repr_set_value(space, w_self, w_new_value):
@@ -5720,7 +5728,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'n')
+ raise_attriberr(space, w_self, 'n')
return w_self.n
def Num_set_n(space, w_self, w_new_value):
@@ -5765,7 +5773,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 's')
+ raise_attriberr(space, w_self, 's')
return w_self.s
def Str_set_s(space, w_self, w_new_value):
@@ -5810,7 +5818,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Attribute_set_value(space, w_self, w_new_value):
@@ -5833,7 +5841,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'attr')
+ raise_attriberr(space, w_self, 'attr')
return space.wrap(w_self.attr)
def Attribute_set_attr(space, w_self, w_new_value):
@@ -5854,7 +5862,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ctx')
+ raise_attriberr(space, w_self, 'ctx')
return expr_context_to_class[w_self.ctx - 1]()
def Attribute_set_ctx(space, w_self, w_new_value):
@@ -5903,7 +5911,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Subscript_set_value(space, w_self, w_new_value):
@@ -5926,7 +5934,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'slice')
+ raise_attriberr(space, w_self, 'slice')
return space.wrap(w_self.slice)
def Subscript_set_slice(space, w_self, w_new_value):
@@ -5949,7 +5957,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ctx')
+ raise_attriberr(space, w_self, 'ctx')
return expr_context_to_class[w_self.ctx - 1]()
def Subscript_set_ctx(space, w_self, w_new_value):
@@ -5998,7 +6006,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'id')
+ raise_attriberr(space, w_self, 'id')
return space.wrap(w_self.id)
def Name_set_id(space, w_self, w_new_value):
@@ -6019,7 +6027,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ctx')
+ raise_attriberr(space, w_self, 'ctx')
return expr_context_to_class[w_self.ctx - 1]()
def Name_set_ctx(space, w_self, w_new_value):
@@ -6063,7 +6071,7 @@
def List_get_elts(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'elts')
+ raise_attriberr(space, w_self, 'elts')
if w_self.w_elts is None:
if w_self.elts is None:
list_w = []
@@ -6083,7 +6091,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ctx')
+ raise_attriberr(space, w_self, 'ctx')
return expr_context_to_class[w_self.ctx - 1]()
def List_set_ctx(space, w_self, w_new_value):
@@ -6128,7 +6136,7 @@
def Tuple_get_elts(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'elts')
+ raise_attriberr(space, w_self, 'elts')
if w_self.w_elts is None:
if w_self.elts is None:
list_w = []
@@ -6148,7 +6156,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ctx')
+ raise_attriberr(space, w_self, 'ctx')
return expr_context_to_class[w_self.ctx - 1]()
def Tuple_set_ctx(space, w_self, w_new_value):
@@ -6197,7 +6205,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return w_self.value
def Const_set_value(space, w_self, w_new_value):
@@ -6315,7 +6323,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'lower')
+ raise_attriberr(space, w_self, 'lower')
return space.wrap(w_self.lower)
def Slice_set_lower(space, w_self, w_new_value):
@@ -6338,7 +6346,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 2:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'upper')
+ raise_attriberr(space, w_self, 'upper')
return space.wrap(w_self.upper)
def Slice_set_upper(space, w_self, w_new_value):
@@ -6361,7 +6369,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'step')
+ raise_attriberr(space, w_self, 'step')
return space.wrap(w_self.step)
def Slice_set_step(space, w_self, w_new_value):
@@ -6406,7 +6414,7 @@
def ExtSlice_get_dims(space, w_self):
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'dims')
+ raise_attriberr(space, w_self, 'dims')
if w_self.w_dims is None:
if w_self.dims is None:
list_w = []
@@ -6451,7 +6459,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'value')
+ raise_attriberr(space, w_self, 'value')
return space.wrap(w_self.value)
def Index_set_value(space, w_self, w_new_value):
@@ -6722,7 +6730,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'target')
+ raise_attriberr(space, w_self, 'target')
return space.wrap(w_self.target)
def comprehension_set_target(space, w_self, w_new_value):
@@ -6745,7 +6753,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 2:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'iter')
+ raise_attriberr(space, w_self, 'iter')
return space.wrap(w_self.iter)
def comprehension_set_iter(space, w_self, w_new_value):
@@ -6764,7 +6772,7 @@
def comprehension_get_ifs(space, w_self):
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'ifs')
+ raise_attriberr(space, w_self, 'ifs')
if w_self.w_ifs is None:
if w_self.ifs is None:
list_w = []
@@ -6811,7 +6819,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'lineno')
+ raise_attriberr(space, w_self, 'lineno')
return space.wrap(w_self.lineno)
def excepthandler_set_lineno(space, w_self, w_new_value):
@@ -6832,7 +6840,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 2:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'col_offset')
+ raise_attriberr(space, w_self, 'col_offset')
return space.wrap(w_self.col_offset)
def excepthandler_set_col_offset(space, w_self, w_new_value):
@@ -6862,7 +6870,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 4:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'type')
+ raise_attriberr(space, w_self, 'type')
return space.wrap(w_self.type)
def ExceptHandler_set_type(space, w_self, w_new_value):
@@ -6885,7 +6893,7 @@
if w_obj is not None:
return w_obj
if not w_self.initialization_state & 8:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'name')
+ raise_attriberr(space, w_self, 'name')
return space.wrap(w_self.name)
def ExceptHandler_set_name(space, w_self, w_new_value):
@@ -6904,7 +6912,7 @@
def ExceptHandler_get_body(space, w_self):
if not w_self.initialization_state & 16:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'body')
+ raise_attriberr(space, w_self, 'body')
if w_self.w_body is None:
if w_self.body is None:
list_w = []
@@ -6947,7 +6955,7 @@
def arguments_get_args(space, w_self):
if not w_self.initialization_state & 1:
- raise operationerrfmt(space.w_AttributeError, "'%T' object has no attribute '%s'", w_self, 'args')
+ raise_attriberr(space, w_self, 'args')
if w_self.w_args is None:
if w_self.args is None:
More information about the pypy-commit
mailing list