Commit 4f51f979 authored by Ronan Lamy's avatar Ronan Lamy

hg merge default

parents bf21f4a6 1713dd83
......@@ -6,3 +6,11 @@ ff4af8f318821f7f5ca998613a60fca09aa137da release-1.7
9b623bc48b5950cf07184462a0e48f2c4df0d720 pypy-2.1-beta1-arm
9b623bc48b5950cf07184462a0e48f2c4df0d720 pypy-2.1-beta1-arm
ab0dd631c22015ed88e583d9fdd4c43eebf0be21 pypy-2.1-beta1-arm
20e51c4389ed4469b66bb9d6289ce0ecfc82c4b9 release-2.3.0
20e51c4389ed4469b66bb9d6289ce0ecfc82c4b9 release-2.3.0
0000000000000000000000000000000000000000 release-2.3.0
394146e9bb673514c61f0150ab2013ccf78e8de7 release-2.3
32f35069a16d819b58c1b6efb17c44e3e53397b2 release-2.2=3.1
32f35069a16d819b58c1b6efb17c44e3e53397b2 release-2.3.1
32f35069a16d819b58c1b6efb17c44e3e53397b2 release-2.2=3.1
0000000000000000000000000000000000000000 release-2.2=3.1
......@@ -44,31 +44,33 @@ copyrighted by one or more of the following people and organizations:
Alex Gaynor
Michael Hudson
David Schneider
Matti Picus
Brian Kearns
Philip Jenvey
Holger Krekel
Christian Tismer
Hakan Ardo
Benjamin Peterson
Matti Picus
Philip Jenvey
Manuel Jacob
Anders Chrigstrom
Brian Kearns
Eric van Riet Paap
Wim Lavrijsen
Ronan Lamy
Richard Emslie
Alexander Schremmer
Wim Lavrijsen
Dan Villiom Podlaski Christiansen
Manuel Jacob
Lukas Diekmann
Sven Hager
Anders Lehmann
Aurelien Campeas
Niklaus Haldimann
Ronan Lamy
Camillo Bruni
Laura Creighton
Toon Verwaest
Remi Meier
Leonardo Santagada
Seo Sanghyeon
Romain Guillebert
Justin Peel
Ronny Pfannschmidt
David Edelsohn
......@@ -80,52 +82,62 @@ copyrighted by one or more of the following people and organizations:
Daniel Roberts
Niko Matsakis
Adrien Di Mascio
Ludovic Aubry
Alexander Hesse
Ludovic Aubry
Jacob Hallen
Romain Guillebert
Jason Creighton
Alex Martelli
Michal Bendowski
Jan de Mooij
stian
Michael Foord
Stephan Diehl
Stefan Schwarzer
Valentino Volonghi
Tomek Meka
Patrick Maupin
stian
Bob Ippolito
Bruno Gola
Jean-Paul Calderone
Timo Paulssen
Squeaky
Alexandre Fayolle
Simon Burton
Marius Gedminas
John Witulski
Konstantin Lopuhin
Greg Price
Dario Bertini
Mark Pearse
Simon Cross
Konstantin Lopuhin
Andreas Stührk
Jean-Philippe St. Pierre
Guido van Rossum
Pavel Vinogradov
Paweł Piotr Przeradowski
Paul deGrandis
Ilya Osadchiy
Tobias Oberstein
Adrian Kuhn
Boris Feigin
Stefano Rivera
tav
Taavi Burns
Georg Brandl
Bert Freudenberg
Stian Andreassen
Stefano Rivera
Laurence Tratt
Wanja Saatkamp
Ivan Sichmann Freitas
Gerald Klix
Mike Blume
Taavi Burns
Oscar Nierstrasz
Stefan H. Muller
Jeremy Thurgood
Gregor Wegberg
Rami Chowdhury
Tobias Pape
Edd Barrett
David Malcolm
Eugene Oden
Henry Mason
......@@ -135,18 +147,16 @@ copyrighted by one or more of the following people and organizations:
Dusty Phillips
Lukas Renggli
Guenter Jantzen
Tobias Oberstein
Remi Meier
Ned Batchelder
Amit Regmi
Ben Young
Nicolas Chauvat
Andrew Durdin
Andrew Chambers
Michael Schneider
Nicholas Riley
Jason Chu
Igor Trindade Oliveira
Jeremy Thurgood
Rocco Moretti
Gintautas Miliauskas
Michael Twomey
......@@ -159,18 +169,19 @@ copyrighted by one or more of the following people and organizations:
Karl Bartel
Brian Dorsey
Victor Stinner
Andrews Medina
Stuart Williams
Jasper Schulz
Christian Hudon
Toby Watson
Antoine Pitrou
Aaron Iles
Michael Cheng
Justas Sadzevicius
Mikael Schönenberg
Gasper Zejn
Neil Shepperd
Mikael Schönenberg
Elmo Mäntynen
Tobias Pape
Jonathan David Riehl
Stanislaw Halik
Anders Qvist
......@@ -182,19 +193,18 @@ copyrighted by one or more of the following people and organizations:
Alexander Sedov
Corbin Simpson
Christopher Pope
Laurence Tratt
Guillebert Romain
wenzhuman
Christian Tismer
Marc Abramowitz
Dan Stromberg
Stefano Parmesan
Christian Hudon
Alexis Daboville
Jens-Uwe Mager
Carl Meyer
Karl Ramm
Pieter Zieschang
Gabriel
Paweł Piotr Przeradowski
Lukas Vacek
Andrew Dalke
Sylvain Thenault
Nathan Taylor
......@@ -203,8 +213,11 @@ copyrighted by one or more of the following people and organizations:
Alejandro J. Cura
Jacob Oscarson
Travis Francis Athougies
Ryan Gonzalez
Kristjan Valur Jonsson
Sebastian Pawluś
Neil Blakey-Milner
anatoly techtonik
Lutz Paelike
Lucio Torre
Lars Wassermann
......@@ -218,13 +231,14 @@ copyrighted by one or more of the following people and organizations:
Martin Blais
Lene Wagner
Tomo Cocoa
Andrews Medina
roberto@goyle
Yury V. Zaytsev
Anna Katrina Dominguez
William Leslie
Bobby Impollonia
timo@eistee.fritz.box
Andrew Thompson
Yusei Tahara
Ben Darnell
Roberto De Ioris
Juan Francisco Cantero Hurtado
Godefroid Chappelle
......@@ -234,28 +248,39 @@ copyrighted by one or more of the following people and organizations:
Michael Hudson-Doyle
Anders Sigfridsson
Yasir Suhail
rafalgalczynski@gmail.com
Floris Bruynooghe
Laurens Van Houtven
Akira Li
Gustavo Niemeyer
Stephan Busemann
Anna Katrina Dominguez
Rafał Gałczyński
Yusei Tahara
Christian Muirhead
James Lan
shoma hosaka
Daniel Neuhäuser
Daniel Neuh?user
Matthew Miller
Buck Golemon
Konrad Delong
Dinu Gherman
Chris Lambacher
coolbutuseless@gmail.com
Jim Baker
Rodrigo Araújo
w31rd0
Jim Baker
James Robert
Armin Ronacher
Brett Cannon
yrttyr
aliceinwire
OlivierBlanvillain
Zooko Wilcox-O Hearn
Tomer Chachamu
Christopher Groskopf
Asmo Soinio
Stefan Marr
jiaaro
opassembler.py
Antony Lee
Jim Hunziker
......@@ -263,12 +288,13 @@ copyrighted by one or more of the following people and organizations:
Even Wiik Thomassen
jbs
soareschen
Kurt Griffiths
Mike Bayer
Flavio Percoco
Kristoffer Kleine
yasirs
Michael Chermside
Anna Ravencroft
Andrew Chambers
Julien Phalip
Dan Loewenherz
......
......@@ -160,15 +160,14 @@ if __name__ == '__main__':
" | instructions in dotviewer/sshgraphserver.py\n")
try:
import pygame
except ImportError:
if isinstance(e, pygame.error):
print >> f, help
except Exception, e:
f.seek(0)
f.truncate()
print >> f, "ImportError"
print >> f, "%s: %s" % (e.__class__.__name__, e)
print >> f, " | Pygame is not installed; either install it, or"
print >> f, help
else:
if isinstance(e, pygame.error):
print >> f, help
io.sendmsg(msgstruct.MSG_ERROR, f.getvalue())
else:
listen_server(sys.argv[1])
......@@ -53,6 +53,12 @@ int pypy_execute_source(char *source);
int pypy_execute_source_ptr(char *source, void* ptr);
/* Windows hackery */
#if defined(_MSC_VER)
# pragma comment(lib,"python27.lib")
#endif
#ifdef __cplusplus
}
#endif
......
......@@ -161,7 +161,7 @@ def label(code):
# ____________________________________________________________
def main():
import os, sys
import os, sys, types
from optparse import OptionParser
usage = "cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
parser = OptionParser(usage=usage)
......@@ -184,12 +184,10 @@ def main():
sys.path.insert(0, os.path.dirname(progname))
with open(progname, 'rb') as fp:
code = compile(fp.read(), progname, 'exec')
globs = {
'__file__': progname,
'__name__': '__main__',
'__package__': None,
}
runctx(code, globs, None, options.outfile, options.sort)
mainmod = types.ModuleType('__main__')
mainmod.__file__ = progname
mainmod.__package__ = None
runctx(code, mainmod.__dict__, None, options.outfile, options.sort)
else:
parser.print_usage()
return parser
......
......@@ -389,12 +389,13 @@ class CDLL(object):
func.__name__ = name_or_ordinal
return func
class PyDLL(CDLL):
"""This class represents the Python library itself. It allows to
access Python API functions. The GIL is not released, and
Python exceptions are handled correctly.
"""
_func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
# Not in PyPy
#class PyDLL(CDLL):
# """This class represents the Python library itself. It allows to
# access Python API functions. The GIL is not released, and
# Python exceptions are handled correctly.
# """
# _func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
if _os.name in ("nt", "ce"):
......@@ -447,15 +448,8 @@ class LibraryLoader(object):
return self._dlltype(name)
cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)
if _os.name in ("nt", "ce"):
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform == "cygwin":
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
else:
pythonapi = PyDLL(None)
# not on PyPy
#pydll = LibraryLoader(PyDLL)
if _os.name in ("nt", "ce"):
windll = LibraryLoader(WinDLL)
......
......@@ -4,6 +4,7 @@ A testcase which accesses *values* in a dll.
import unittest
from ctypes import *
from ctypes.test import xfail
import _ctypes_test
......@@ -23,7 +24,8 @@ class ValuesTestCase(unittest.TestCase):
class Win_ValuesTestCase(unittest.TestCase):
"""This test only works when python itself is a dll/shared library"""
@xfail
def test_optimizeflag(self):
# This test accesses the Py_OptimizeFlag intger, which is
# exported by the Python dll.
......@@ -40,6 +42,7 @@ class ValuesTestCase(unittest.TestCase):
else:
self.assertEqual(opt, 2)
@xfail
def test_frozentable(self):
# Python exports a PyImport_FrozenModules symbol. This is a
# pointer to an array of struct _frozen entries. The end of the
......@@ -75,6 +78,7 @@ class ValuesTestCase(unittest.TestCase):
from ctypes import _pointer_type_cache
del _pointer_type_cache[struct_frozen]
@xfail
def test_undefined(self):
self.assertRaises(ValueError, c_int.in_dll, pydll, "Undefined_Symbol")
......
......@@ -86,9 +86,10 @@ if os.name == "posix" and sys.platform == "darwin":
elif os.name == "posix":
# Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
import re, tempfile, errno
import re, errno
def _findLib_gcc(name):
import tempfile
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
fdout, ccout = tempfile.mkstemp()
os.close(fdout)
......
......@@ -422,7 +422,8 @@ def _compile(pathname, timestamp):
saved back to the filesystem for future imports. The source file's
modification timestamp must be provided as a Long value.
"""
codestring = open(pathname, 'rU').read()
with open(pathname, 'rU') as fp:
codestring = fp.read()
if codestring and codestring[-1] != '\n':
codestring = codestring + '\n'
code = __builtin__.compile(codestring, pathname, 'exec')
......@@ -603,8 +604,8 @@ class DynLoadSuffixImporter:
self.desc = desc
def import_file(self, filename, finfo, fqname):
fp = open(filename, self.desc[1])
module = imp.load_module(fqname, fp, filename, self.desc)
with open(filename, self.desc[1]) as fp:
module = imp.load_module(fqname, fp, filename, self.desc)
module.__file__ = filename
return 0, module, { }
......