diff --git a/.github/appveyor.yml b/.github/appveyor.yml index c69e0ad2c4f..9f23cc5e3ec 100644 --- a/.github/appveyor.yml +++ b/.github/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.7build{build} +version: 2.8build{build} clone_depth: 5 branches: only: @@ -30,6 +30,6 @@ build_script: - cmd: PCbuild\build.bat -e - cmd: PCbuild\python.exe -m test.pythoninfo test_script: - - cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest -j2 + - cmd: PCbuild\rt.bat -q -uall -u-cpu -w -j3 -x test_concurrent_futures test_multiprocessing test_selectors environment: HOST_PYTHON: C:\Python36\python.exe diff --git a/.gitignore b/.gitignore index 790d8904db3..83a94795aee 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ PCbuild/*.VC.opendb PCbuild/amd64/ PCbuild/obj/ PCbuild/win32/ +PCbuild/.vs/ Parser/pgen Parser/pgen.stamp autom4te.cache diff --git a/Include/eval.h b/Include/eval.h index af41ebf9bb7..d493771b4e5 100644 --- a/Include/eval.h +++ b/Include/eval.h @@ -21,9 +21,9 @@ PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx28(PyCodeObject *co, PyObject *globals, PyObject *locals, - PyObject **args, int argc, - PyObject **kwds, int kwdc, - PyObject **defs, int defc, + PyObject **args, int argcount, + PyObject **kws, int kwcount, + PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure); PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); diff --git a/PC/VS9.0/build.bat b/PC/VS9.0/build.bat index 2c846a54fed..7898485d076 100644 --- a/PC/VS9.0/build.bat +++ b/PC/VS9.0/build.bat @@ -9,7 +9,7 @@ rem -r Target Rebuild instead of Build rem -t Set the target manually (Build, Rebuild, or Clean) rem -d Set the configuration to Debug rem -e Pull in external libraries using get_externals.bat -rem -k Attempt to kill any running Pythons before building +rem -k Attempt to kill any running Tauthons before building setlocal set platf=Win32 @@ -43,8 +43,8 @@ if '%platf%'=='x64' ( ) rem Can't use builddir until we're in a new command... if '%platf%'=='x64' ( - rem Needed for buliding OpenSSL - set HOST_PYTHON=%builddir%python%dbg_ext%.exe + rem Needed for building OpenSSL + set HOST_PYTHON=%builddir%tauthon%dbg_ext%.exe ) rem Setup the environment diff --git a/PC/VS9.0/build_pgo.bat b/PC/VS9.0/build_pgo.bat index a37b5bfd93f..6d6f0b98092 100644 --- a/PC/VS9.0/build_pgo.bat +++ b/PC/VS9.0/build_pgo.bat @@ -31,9 +31,9 @@ rem build the instrumented version call build -p %platf% -c PGInstrument rem remove .pyc files, .pgc files and execute the job -%PGI%\python.exe rmpyc.py %clrpath% +%PGI%\tauthon.exe rmpyc.py %clrpath% del %PGI%\*.pgc -%PGI%\python.exe %job% +%PGI%\tauthon.exe %job% rem finally build the optimized version if exist %PGO% del /s /q %PGO% diff --git a/PC/VS9.0/build_ssl.bat b/PC/VS9.0/build_ssl.bat index 2531a5be935..ac2d8af04e3 100644 --- a/PC/VS9.0/build_ssl.bat +++ b/PC/VS9.0/build_ssl.bat @@ -1,11 +1,11 @@ @echo off if not defined HOST_PYTHON ( if %1 EQU Debug ( - set HOST_PYTHON=python_d.exe - if not exist python27_d.dll exit 1 + set HOST_PYTHON=tauthon_d.exe + if not exist tauthon28_d.dll exit 1 ) ELSE ( - set HOST_PYTHON=python.exe - if not exist python27.dll exit 1 + set HOST_PYTHON=tauthon.exe + if not exist tauthon28.dll exit 1 ) ) %HOST_PYTHON% build_ssl.py %1 %2 %3 diff --git a/PC/VS9.0/idle.bat b/PC/VS9.0/idle.bat index dcb0485af7d..5a0bb5302d1 100644 --- a/PC/VS9.0/idle.bat +++ b/PC/VS9.0/idle.bat @@ -1,13 +1,13 @@ @echo off rem start idle rem Usage: idle [-d] -rem -d Run Debug build (python_d.exe). Else release build. +rem -d Run Debug build (tauthon_d.exe). Else release build. setlocal -set exe=python +set exe=tauthon PATH %PATH%;..\..\tcltk\bin -if "%1"=="-d" (set exe=python_d) & shift +if "%1"=="-d" (set exe=tauthon_d) & shift set cmd=%exe% ../Lib/idlelib/idle.py %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/PC/VS9.0/kill_python.c b/PC/VS9.0/kill_python.c index f3880fc83e2..226de4290c2 100644 --- a/PC/VS9.0/kill_python.c +++ b/PC/VS9.0/kill_python.c @@ -1,5 +1,5 @@ /* - * Helper program for killing lingering python[_d].exe processes before + * Helper program for killing lingering tauthon[_d].exe processes before * building, thus attempting to avoid build failures due to files being * locked. */ @@ -12,13 +12,13 @@ #pragma comment(lib, "psapi") #ifdef _DEBUG -#define PYTHON_EXE (L"python_d.exe") -#define PYTHON_EXE_LEN (12) +#define TAUTHON_EXE (L"tauthon_d.exe") +#define TAUTHON_EXE_LEN (13) #define KILL_PYTHON_EXE (L"kill_python_d.exe") #define KILL_PYTHON_EXE_LEN (17) #else -#define PYTHON_EXE (L"python.exe") -#define PYTHON_EXE_LEN (10) +#define TAUTHON_EXE (L"tauthon.exe") +#define TAUTHON_EXE_LEN (11) #define KILL_PYTHON_EXE (L"kill_python.exe") #define KILL_PYTHON_EXE_LEN (15) #endif @@ -77,7 +77,7 @@ main(int argc, char **argv) /* * Take a snapshot of system processes. Enumerate over the snapshot, - * looking for python processes. When we find one, verify it lives + * looking for tauthon processes. When we find one, verify it lives * in the same directory we live in. If it does, kill it. If we're * unable to kill it, treat this as a fatal error and return 1. * @@ -105,18 +105,18 @@ main(int argc, char **argv) /* * XXX TODO: if we really wanted to be fancy, we could check the - * modules for all processes (not just the python[_d].exe ones) - * and see if any of our DLLs are loaded (i.e. python30[_d].dll), + * modules for all processes (not just the tauthon[_d].exe ones) + * and see if any of our DLLs are loaded (i.e. tauthon30[_d].dll), * as that would also inhibit our ability to rebuild the solution. * Not worth loosing sleep over though; for now, a simple check - * for just the python executable should be sufficient. + * for just the tauthon executable should be sufficient. */ - if (_wcsnicmp(pe.szExeFile, PYTHON_EXE, PYTHON_EXE_LEN)) - /* This isn't a python process. */ + if (_wcsnicmp(pe.szExeFile, TAUTHON_EXE, TAUTHON_EXE_LEN)) + /* This isn't a tauthon process. */ continue; - /* It's a python process, so figure out which directory it's in... */ + /* It's a tauthon process, so figure out which directory it's in... */ hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pe.th32ProcessID); if (hsm == INVALID_HANDLE_VALUE) /* @@ -136,15 +136,15 @@ main(int argc, char **argv) } do { - if (_wcsnicmp(me.szModule, PYTHON_EXE, PYTHON_EXE_LEN)) - /* Wrong module, we're looking for python[_d].exe... */ + if (_wcsnicmp(me.szModule, TAUTHON_EXE, TAUTHON_EXE_LEN)) + /* Wrong module, we're looking for tauthon[_d].exe... */ continue; if (_wcsnicmp(path, me.szExePath, len)) /* Process doesn't live in our directory. */ break; - /* Python process residing in the right directory, kill it! */ + /* Tauthon process residing in the right directory, kill it! */ hp = OpenProcess(dac, FALSE, pe.th32ProcessID); if (!hp) { printf("OpenProcess failed: %d\n", GetLastError()); diff --git a/PC/VS9.0/pcbuild.sln b/PC/VS9.0/pcbuild.sln index c5e072e12ef..df673119707 100644 --- a/PC/VS9.0/pcbuild.sln +++ b/PC/VS9.0/pcbuild.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tauthon", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058} = {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058} @@ -15,7 +15,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vc {C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tauthonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection diff --git a/PC/VS9.0/pyd_d.vsprops b/PC/VS9.0/pyd_d.vsprops index 85081563148..459b03841a1 100644 --- a/PC/VS9.0/pyd_d.vsprops +++ b/PC/VS9.0/pyd_d.vsprops @@ -31,6 +31,6 @@ /> diff --git a/PC/VS9.0/pyproject.vsprops b/PC/VS9.0/pyproject.vsprops index d4ced7bbf68..1b5cf956bfc 100644 --- a/PC/VS9.0/pyproject.vsprops +++ b/PC/VS9.0/pyproject.vsprops @@ -38,11 +38,11 @@ /> @@ -62,7 +62,7 @@ /> @@ -62,7 +62,7 @@ /> @@ -204,7 +204,7 @@ /> @@ -346,7 +346,7 @@ /> - + + diff --git a/PCbuild/python.props b/PCbuild/python.props index d2b19915581..21ae1a33985 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -97,8 +97,8 @@ )) )) - - python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + tauthon$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 556a8f25ca9..5642cd05456 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -65,7 +65,7 @@ Debug Used to build Python with extra debugging capabilities, equivalent to using ./configure --with-pydebug on UNIX. All binaries built using this configuration have "_d" added to their name: - python27_d.dll, python_d.exe, parser_d.pyd, and so on. Both the + tauthon28_d.dll, tauthon_d.exe, parser_d.pyd, and so on. Both the build and rt (run test) batch files in this directory accept a -d option for debug builds. If you are building Python to help with development of CPython, you will most likely use this configuration. diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d8bac7e4eea..b04b1121e8f 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -41,6 +41,7 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) Py_ssize_t nargs; int isclass = 0; /* initialize to prevent gcc warning */ int meta_from_kws = 0; + PyObject *margs; /* A metaclass is used in two ways during class creation: * @@ -204,7 +205,6 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) Py_INCREF(meta2); } - PyObject *margs; margs = PyTuple_Pack(3, name, bases, ns); if (margs != NULL) { cls = PyEval_CallObjectWithKeywords(meta2, margs, mkw); diff --git a/Python/ceval.c b/Python/ceval.c index ff0ef61e1d1..49dd4b68997 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3897,15 +3897,17 @@ PyEval_EvalCodeEx28(PyCodeObject *co, PyObject *globals, PyObject *locals, if (co->co_flags & (CO_GENERATOR | CO_COROUTINE)) { PyObject *gen; PyObject *coro_wrapper = tstate->coroutine_wrapper; + PyObject *coro_wrap_rep, *co_rep; + int is_coro = co->co_flags & CO_COROUTINE; if (is_coro && tstate->in_coroutine_wrapper) { assert(coro_wrapper != NULL); - PyObject *coro_wrap_rep = PyObject_Repr(coro_wrapper); + coro_wrap_rep = PyObject_Repr(coro_wrapper); if (coro_wrap_rep == NULL) goto fail; - PyObject *co_rep = PyObject_Repr((PyObject *)co); + co_rep = PyObject_Repr((PyObject *)co); if (co_rep == NULL) { Py_DECREF(coro_wrap_rep); goto fail; @@ -3966,12 +3968,12 @@ PyEval_EvalCodeEx28(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject * PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, - PyObject **args, int argcount, PyObject **kws, int kwcount, - PyObject **defs, int defcount, PyObject *closure) + PyObject **args, int argc, PyObject **kwds, int kwdc, + PyObject **defs, int defc, PyObject *closure) { return PyEval_EvalCodeEx28(co, globals, locals, - args, argcount, kws, kwcount, - defs, defcount, NULL, closure); + args, argc, kwds, kwdc, + defs, defc, NULL, closure); } static PyObject * diff --git a/Python/compile.c b/Python/compile.c index fb121bda0f5..bba6ca1c64d 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -485,6 +485,8 @@ compiler_enter_scope(struct compiler *c, identifier name, int scope_type, void *key, int lineno) { struct compiler_unit *u; + PyObject *tuple, *cname, *zero; + int res; u = (struct compiler_unit *)PyObject_Malloc(sizeof( struct compiler_unit)); @@ -517,16 +519,14 @@ compiler_enter_scope(struct compiler *c, identifier name, if (!__class__) return 0; } - PyObject *tuple, *name, *zero; - int res; assert(u->u_scope_type == COMPILER_SCOPE_CLASS); assert(PyDict_Size(u->u_cellvars) == 0); - name = __class__; - if (!name) { + cname = __class__; + if (!cname) { compiler_unit_free(u); return 0; } - tuple = _PyCode_ConstantKey(name); + tuple = _PyCode_ConstantKey(cname); if (!tuple) { compiler_unit_free(u); return 0; @@ -1305,10 +1305,12 @@ compiler_mod(struct compiler *c, mod_ty mod) static int get_ref_type(struct compiler *c, PyObject *name) { + int scope; + if (c->u->u_scope_type == COMPILER_SCOPE_CLASS && !strcmp(PyString_AS_STRING(name), "__class__")) return CELL; - int scope = PyST_GetScope(c->u->u_ste, name); + scope = PyST_GetScope(c->u->u_ste, name); if (scope == 0) { char buf[350]; PyOS_snprintf(buf, sizeof(buf),