Christian Heimes
61e4590ec9
Build bots are working again - removing the hack
2008-03-27 10:35:52 +00:00
Christian Heimes
81caa790b6
Quick 'n dirty hack: Increase the magic by 2 to force a rebuild of pyc/pyo files on the build bots
2008-03-27 09:02:33 +00:00
Christian Heimes
7f23d86107
Initialize PyCompilerFlags cf_flags with 0
2008-03-26 22:51:58 +00:00
Christian Heimes
3c60833e1e
Patch #2477 : Added from __future__ import unicode_literals
...
The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
2008-03-26 22:01:37 +00:00
Nick Coghlan
7af53be66f
Speed up with statements by storing the __exit__ method on the stack instead of in a temp variable (bumps the magic number for pyc files)
2008-03-07 14:13:28 +00:00
Christian Heimes
5e8e6d2454
MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.
2008-02-23 23:59:45 +00:00
Christian Heimes
4034685a58
Issue #2051 and patch from Alexander Belopolsky:
...
Permission for pyc and pyo files are inherited from the py file.
2008-02-23 17:52:07 +00:00
Christian Heimes
0d9244332b
Fixed some references leaks in sys.
2008-01-30 17:21:22 +00:00
Christian Heimes
3403f1589d
Fixed #1776 . __import__() no longer imports modules by file name
2008-01-09 19:56:33 +00:00
Georg Brandl
aed6c66aa8
patch #1668 : clarify envvar docs; rename THREADDEBUG to PYTHONTHREADDEBUG.
2008-01-07 17:25:53 +00:00
Georg Brandl
2da0fceba7
Patch #602345 by Neal Norwitz and me: add -B option and PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
2008-01-07 17:09:35 +00:00
Christian Heimes
000a074c95
Modified PyImport_Import and PyImport_ImportModule to always use absolute imports by calling __import__ with an explicit level of 0
...
Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
2008-01-03 22:16:32 +00:00
Raymond Hettinger
effde12f5f
Speed-up dictionary constructor by about 10%.
...
New opcode, STORE_MAP saves the compiler from awkward stack manipulations
and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem.
Old disassembly:
0 BUILD_MAP 0
3 DUP_TOP
4 LOAD_CONST 1 (1)
7 ROT_TWO
8 LOAD_CONST 2 ('x')
11 STORE_SUBSCR
12 DUP_TOP
13 LOAD_CONST 3 (2)
16 ROT_TWO
17 LOAD_CONST 4 ('y')
20 STORE_SUBSCR
New disassembly:
0 BUILD_MAP 0
3 LOAD_CONST 1 (1)
6 LOAD_CONST 2 ('x')
9 STORE_MAP
10 LOAD_CONST 3 (2)
13 LOAD_CONST 4 ('y')
16 STORE_MAP
2007-12-18 18:26:18 +00:00
Nick Coghlan
ef01d822aa
Implement PEP 366
2007-12-03 12:55:17 +00:00
Nick Coghlan
327a39b047
Patch #1739468 : Directories and zipfiles containing __main__.py are now executable
2007-11-18 11:56:28 +00:00
Christian Heimes
004c1c1562
Backport of Guido's review of my patch.
2007-11-07 18:30:22 +00:00
Christian Heimes
cea681be19
Backported fix for bug #1392 from py3k branch r58903.
2007-11-07 17:50:54 +00:00
Georg Brandl
add36e5fdf
Second half of #1752175 : #ifdef out references to PyImport_DynLoadFiletab if HAVE_DYNAMIC_LOADING is not defined.
2007-08-23 18:08:06 +00:00
Georg Brandl
d7e9f608c3
Revert accidental checkins from last commit.
2007-08-21 06:03:43 +00:00
Georg Brandl
fdca6d8599
Demand version 2.5.1 since 2.5 has a bug with codecs.open context managers.
2007-08-21 06:01:18 +00:00
Martin v. Löwis
6819210b9e
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
...
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00
Neal Norwitz
2fca81cc4c
Fix indentation (whitespace only).
2007-05-30 04:53:41 +00:00
Kristján Valur Jónsson
67387fb4aa
Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h
2007-04-25 00:17:39 +00:00
Collin Winter
47c52a8b60
Inline PyImport_GetModulesReloading().
2007-03-13 23:02:15 +00:00
Neal Norwitz
75c7c80ee5
Fix some style nits:
...
* lines too long
* wrong indentation
* space after a function name
* wrong function name in error string
* simplifying some logic
Also add an error check to PyDict_SetItemString.
2007-03-13 05:31:38 +00:00
Collin Winter
276887b16d
Bug #742342 : make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167 .
...
Will backport.
2007-03-12 16:11:39 +00:00
Georg Brandl
7478096148
Typos.
2007-03-10 07:38:14 +00:00
Neal Norwitz
cbeb687c68
Update the peephole optimizer to remove more dead code (jumps after returns)
...
and inline jumps to returns.
2006-10-14 21:33:38 +00:00
Brett Cannon
5a9aa4f31c
Fix minor typo in a comment.
2006-10-03 21:58:55 +00:00
Brett Cannon
94b69f6ba3
Very minor grammatical fix in a comment.
2006-09-28 22:10:14 +00:00
Neal Norwitz
2a399b0f11
Properly handle a NULL returned from PyArena_New().
...
(Also fix some whitespace)
Klocwork #364 .
2006-09-11 04:28:16 +00:00
Georg Brandl
98775dfebc
Bug #1550983 : emit better error messages for erroneous relative
...
imports (if not in package and if beyond toplevel package).
2006-09-06 06:09:31 +00:00
Neal Norwitz
dac090d3e6
Bug #1520864 (again): unpacking singleton tuples in list comprehensions and
...
generator expressions (x for x, in ... ) works again.
Sigh, I only fixed for loops the first time, not list comps and genexprs too.
I couldn't find any more unpacking cases where there is a similar bug lurking.
This code should be refactored to eliminate the duplication. I'm sure
the listcomp/genexpr code can be refactored. I'm not sure if the for loop
can re-use any of the same code though.
Will backport to 2.5 (the only place it matters).
2006-09-05 03:53:08 +00:00
Neal Norwitz
3cb31ac704
cpathname could be NULL if it was longer than MAXPATHLEN. Don't try
...
to write the .pyc to NULL.
Check results of PyList_GetItem() and PyModule_GetDict() are not NULL.
Klocwork 282, 283, 285
2006-08-13 18:10:47 +00:00
Neal Norwitz
9a70f95ee8
There were really two issues
2006-08-04 05:12:19 +00:00
Neal Norwitz
4ffedadb10
Bug #1191458 : tracing over for loops now produces a line event
...
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
2006-08-04 04:58:47 +00:00
Neal Norwitz
0d62a06206
Patch #1531113 : Fix augmented assignment with yield expressions.
...
Also fix a SystemError when trying to assign to yield expressions.
2006-07-30 06:53:31 +00:00
Phillip J. Eby
f7575d0cb7
Bug #1529871 : The speed enhancement patch #921466 broke Python's compliance
...
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
2006-07-28 21:12:07 +00:00
Neal Norwitz
33722aec57
Speel initialise write. Tanks Anthony.
2006-07-21 07:59:02 +00:00
Neal Norwitz
e1fdb32ff2
Handle allocation failures gracefully. Found with failmalloc.
...
Many (all?) of these could be backported.
2006-07-21 05:32:28 +00:00
Neal Norwitz
c0cde4da2a
Fix memory leak under some conditions.
...
Reported by Klocwork, #98 .
2006-07-16 02:17:36 +00:00
Neal Norwitz
a1f1090109
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
2006-07-12 07:28:29 +00:00
Neal Norwitz
edef2be4af
Bug #1520864 : unpacking singleton tuples in for loop (for x, in) work again.
2006-07-12 05:26:17 +00:00
Neal Norwitz
a4df11d9c3
Fix refleaks reported by Shane Hathaway in SF patch #1515361 . This change
...
contains only the changes related to leaking the copy variable.
2006-07-06 04:28:59 +00:00
Georg Brandl
5f6861df93
Correct None refcount issue in Mac modules. (Are they
...
still used?)
2006-05-28 21:57:35 +00:00
Georg Brandl
0fd1291c38
The empty string is a valid import path.
...
(fixes #1496539 )
2006-05-28 20:11:45 +00:00
Georg Brandl
f4ef11659c
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
...
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
2006-05-26 18:03:31 +00:00
Georg Brandl
684fd0c8ec
Replace PyObject_CallFunction calls with only object args
...
with PyObject_CallFunctionObjArgs, which is 30% faster.
2006-05-25 19:15:31 +00:00
Thomas Wouters
9df4e6f673
- Add new Warning class, ImportWarning
...
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
2006-04-27 23:13:20 +00:00
Anthony Baxter
ac6bd46d5c
spread the extern "C" { } magic pixie dust around. Python itself builds now
...
using a C++ compiler. Still lots and lots of errors in the modules built by
setup.py, and a bunch of warnings from g++ in the core.
2006-04-13 02:06:09 +00:00