[pypy-svn] r70400 - in pypy/branch/virtual-forcing: . pypy/doc pypy/lib/app_test/ctypes_tests pypy/module/imp/test pypy/module/posix/test pypy/translator/goal
arigo at codespeak.net
arigo at codespeak.net
Mon Jan 4 17:48:35 CET 2010
Author: arigo
Date: Mon Jan 4 17:48:34 2010
New Revision: 70400
Modified:
pypy/branch/virtual-forcing/LICENSE
pypy/branch/virtual-forcing/pypy/doc/coding-guide.txt
pypy/branch/virtual-forcing/pypy/doc/getting-started.txt
pypy/branch/virtual-forcing/pypy/lib/app_test/ctypes_tests/test_keepalive.py
pypy/branch/virtual-forcing/pypy/module/imp/test/test_import.py
pypy/branch/virtual-forcing/pypy/module/posix/test/test_posix2.py
pypy/branch/virtual-forcing/pypy/translator/goal/app_main.py
Log:
Merge changes from trunk, r70326:70399.
Modified: pypy/branch/virtual-forcing/LICENSE
==============================================================================
--- pypy/branch/virtual-forcing/LICENSE (original)
+++ pypy/branch/virtual-forcing/LICENSE Mon Jan 4 17:48:34 2010
@@ -27,7 +27,7 @@
DEALINGS IN THE SOFTWARE.
-PyPy Copyright holders 2003-2009
+PyPy Copyright holders 2003-2010
-----------------------------------
Except when otherwise stated (look for LICENSE files or information at
Modified: pypy/branch/virtual-forcing/pypy/doc/coding-guide.txt
==============================================================================
--- pypy/branch/virtual-forcing/pypy/doc/coding-guide.txt (original)
+++ pypy/branch/virtual-forcing/pypy/doc/coding-guide.txt Mon Jan 4 17:48:34 2010
@@ -160,7 +160,8 @@
An example can be found in the current implementation which is quite
elegant: For the definition of all the opcodes of the Python
interpreter, the module ``dis`` is imported and used to initialize our
-bytecode interpreter. (See ``__initclass__`` in `pyopcode.py`_). This
+bytecode interpreter. (See ``__initclass__`` in
+`pypy/interpreter/pyopcode.py`_). This
saves us from adding extra modules to PyPy. The import code is run at
startup time, and we are allowed to use the CPython builtin import
function.
@@ -173,8 +174,6 @@
enables the code generator to emit efficient machine level replacements
for pure integer objects, for instance.
-.. _`pyopcode.py`: http://codespeak.net/svn/pypy/dist/pypy/interpreter/pyopcode.py
-
Restricted Python
=================
Modified: pypy/branch/virtual-forcing/pypy/doc/getting-started.txt
==============================================================================
--- pypy/branch/virtual-forcing/pypy/doc/getting-started.txt (original)
+++ pypy/branch/virtual-forcing/pypy/doc/getting-started.txt Mon Jan 4 17:48:34 2010
@@ -35,22 +35,31 @@
Before you can play with PyPy, you will need to obtain a copy
of the sources. This can be done either by `downloading them
from the download page`_ or by checking them out from the
-repository using subversion. We suggest using subversion as it
-offers access to the most recent versions.
+repository using subversion. We suggest using subversion if one
+wants to access the current development.
.. _`downloading them from the download page`: download.html
If you choose to use subversion, you must issue the following command on your
command line, DOS box, or terminal::
- svn co http://codespeak.net/svn/pypy/dist pypy-dist
+ svn co http://codespeak.net/svn/pypy/trunk pypy-trunk
+
+This will check out the subversion head and place it into a directory
+named ``pypy-trunk``, and will get you the PyPy source in
+``pypy-trunk/pypy`` and documentation files in ``pypy-trunk/pypy/doc``.
+We try to ensure that the head is always stable, but it might
+occasionally be broken. You may want to check out `our nightly tests:`_
+find a revision (5-digit number) that passed at least the
+``{own}`` and ``{applevel}`` tests (corresponding to a ``+`` sign on the
+line ``success``) and then check out using::
+
+ svn co -rXXXXX http://codespeak.net/svn/pypy/trunk pypy-trunk
+
+where XXXXX is the revision number.
+
+.. _`our nightly tests:`: http://codespeak.net:8099/summary?branch=<trunk>
-This will check out the most recent stable release from subversion and
-place it into a directory named ``pypy-dist``, and will get you the PyPy
-source in ``pypy-dist/pypy`` and documentation files in
-``pypy-dist/pypy/doc``. If you would prefer to check out the "cutting edge"
-version of PyPy - which may not always be stable! - then check out
-from ``http://codespeak.net/svn/pypy/trunk`` intead.
Where to go from here
----------------------
Modified: pypy/branch/virtual-forcing/pypy/lib/app_test/ctypes_tests/test_keepalive.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/lib/app_test/ctypes_tests/test_keepalive.py (original)
+++ pypy/branch/virtual-forcing/pypy/lib/app_test/ctypes_tests/test_keepalive.py Mon Jan 4 17:48:34 2010
@@ -205,3 +205,33 @@
s.r = r
# obscure
assert s._objects == {'1': {}, '0:1': {'1': stuff}}
+
+ def test_c_char_p(self):
+ n = 2
+ xs = "hello" * n
+ x = c_char_p(xs)
+ del xs
+ import gc; gc.collect()
+ print 'x =', repr(x)
+ assert x.value == 'hellohello'
+ assert x._objects.keys() == ['0']
+ #
+ class datum(Structure):
+ _fields_ = [
+ ('dptr', c_char_p),
+ ('dsize', c_int),
+ ]
+ for wrap in [False, True]:
+ n = 2
+ xs = "hello" * n
+ if wrap:
+ xs = c_char_p(xs)
+ dat = datum()
+ dat.dptr = xs
+ dat.dsize = 15
+ del xs
+ import gc; gc.collect()
+ print 'dat.dptr =', repr(dat.dptr)
+ print 'dat._objects =', repr(dat._objects)
+ assert dat.dptr == "hellohello"
+ assert dat._objects.keys() == ['0']
Modified: pypy/branch/virtual-forcing/pypy/module/imp/test/test_import.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/module/imp/test/test_import.py (original)
+++ pypy/branch/virtual-forcing/pypy/module/imp/test/test_import.py Mon Jan 4 17:48:34 2010
@@ -348,7 +348,7 @@
def test_future_relative_import_error_when_in_non_package(self):
exec """def imp():
from .string import inpackage
- """
+ """.rstrip()
raises(ValueError, imp)
def test_relative_import_with___name__(self):
@@ -434,11 +434,15 @@
def test_reload_builtin(self):
import sys
+ oldpath = sys.path
try:
del sys.setdefaultencoding
except AttributeError:
pass
+
reload(sys)
+
+ assert sys.path is oldpath
assert 'setdefaultencoding' in dir(sys)
def test_reload_infinite(self):
Modified: pypy/branch/virtual-forcing/pypy/module/posix/test/test_posix2.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/module/posix/test/test_posix2.py (original)
+++ pypy/branch/virtual-forcing/pypy/module/posix/test/test_posix2.py Mon Jan 4 17:48:34 2010
@@ -312,7 +312,7 @@
fh.close()
from time import time, sleep
t0 = time()
- sleep(1)
+ sleep(1.1)
os.utime(path, None)
assert os.stat(path).st_atime > t0
os.utime(path, (int(t0), int(t0)))
Modified: pypy/branch/virtual-forcing/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/translator/goal/app_main.py (original)
+++ pypy/branch/virtual-forcing/pypy/translator/goal/app_main.py Mon Jan 4 17:48:34 2010
@@ -228,7 +228,7 @@
newpath.insert(0, '')
# remove duplicates
_seen = {}
- sys.path = []
+ del sys.path[:]
for dir in newpath:
if dir not in _seen:
sys.path.append(dir)
More information about the Pypy-commit
mailing list