Commit graph

3792 commits

Author SHA1 Message Date
Neal Norwitz
7b216c52e4 Make PyGC_Collect() use Py_ssize_t. 2006-03-04 20:01:53 +00:00
Hye-Shik Chang
4b96c1384e - Modernize code to use Py_ssize_t more intensively.
- Do some minor code clean-ups.
2006-03-04 16:08:19 +00:00
Thomas Wouters
857b300b2e Explain why we use the unsigned int format for a signed int variable.
(Should 'code' be cast to the right pointer type?)
2006-03-02 17:58:27 +00:00
Thomas Wouters
83d1266cbd Properly fix Py_SAFE_DOWNCAST-triggerd bugs. 2006-03-02 05:05:17 +00:00
Thomas Wouters
369092be43 Py_SAFE_DOWNCAST isn't quite doing the right thing for going from Py_ssize_t
to an unsigned int (and back again) on 64-bit machines, even though the
actual value of the Py_ssize_t variable is way below 31 bits. I suspect
compiler-error.
2006-03-02 04:48:27 +00:00
Thomas Wouters
26cc63f867 Make Py_ssize_t-clean 2006-03-02 00:21:10 +00:00
Martin v. Löwis
5df2e614e6 Remove UNLESS. 2006-03-01 23:10:49 +00:00
Thomas Wouters
7087f78dbe Use Py_ssize_t for arithmetic on Py_ssize_t's, instead of unsigned ints. 2006-03-01 23:10:05 +00:00
Thomas Wouters
a5fa2a8a13 Fix gcc (4.0.x) warning about use of uninitialized variable. 2006-03-01 22:54:36 +00:00
Martin v. Löwis
49c5da1d88 Patch #1440601: Add col_offset attribute to AST nodes. 2006-03-01 22:49:05 +00:00
Thomas Wouters
3ffa59b137 Rework channelnumber/samplesize detetion code's output variables a bit to
convince gcc (4.0.x) the variables are never used uninitialized (and raising
a proper exception if they ever are.)
2006-03-01 22:45:36 +00:00
Thomas Wouters
f86d1e810d Silence gcc (4.0.x) warning about use of uninitialized value. 2006-03-01 22:15:15 +00:00
Thomas Wouters
9c54448715 Fix brainfart. 2006-03-01 21:59:44 +00:00
Thomas Wouters
1e365b265a Remove gcc (4.0.x) warning about uninitialized value by explicitly setting
the sentinel value in the main function, rather than the helper. This
function could possibly do with an early-out if any of the helper calls ends
up with a len of 0, but I doubt it really matters (how common are malformed
hangul syllables, really?)
2006-03-01 21:58:30 +00:00
Thomas Wouters
9bc844e7be Make Py_ssize_t-clean. 2006-03-01 21:50:07 +00:00
Thomas Wouters
f98db65e52 Make Py_ssize_t-clean. 2006-03-01 21:37:32 +00:00
Martin v. Löwis
6db0e00d57 Change GC refcount to Py_ssize_t. 2006-03-01 16:56:25 +00:00
Tim Peters
67d70eb957 Repair mangled code in the Windows flavor of
posix__getfullpathname().

In partial answer to the now-deleted XXX comment:

	/* XXX(twouters) Why use 'et#' here at all? insize isn't used */

`insize` is an input parameter too, and it was left uninitialized,
leading to seemingly random failures.
2006-03-01 04:35:45 +00:00
Thomas Wouters
68bc4f9ae5 Py_ssize_t-ify. 2006-03-01 01:05:10 +00:00
Thomas Wouters
9d63ccae90 Fix DBEnv's set_tx_timestamp wrapper to be slightly more correct on
non-32bit platforms. Will still only allow 32 bits in a timestamp on Win64,
but at least it won't crash, and it'll work right on platforms where longs
are big enough to contain time_t's.

(A better-working, although conceptually less-right fix would have been to
use Py_ssize_t here, but Martin and Tim won't let me.)
2006-03-01 01:01:55 +00:00
Guido van Rossum
1a5e21e033 Updates to the with-statement:
- New semantics for __exit__() -- it must re-raise the exception
  if type is not None; the with-statement itself doesn't do this.
  (See the updated PEP for motivation.)

- Added context managers to:
  - file
  - thread.LockType
  - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore}
  - decimal.Context

- Added contextlib.py, which defines @contextmanager, nested(), closing().

- Unit tests all around; bot no docs yet.
2006-02-28 21:57:43 +00:00
Tim Peters
85b1052efe Another bit of unconstification. 2006-02-28 18:33:35 +00:00
Thomas Wouters
f7f438ba3b SF patch #1438387, PEP 328: relative and absolute imports.
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
   the import. Only passed to __import__ when it's not -1.

 - __import__() takes an optional 5th argument for the same thing; it
   __defaults to -1 (old semantics: try relative, then absolute)

 - 'from . import name' imports name (be it module or regular attribute)
   from the current module's *package*. Likewise, 'from .module import name'
   will import name from a sibling to the current module.

 - Importing from outside a package is not allowed; 'from . import sys' in a
   toplevel module will not work, nor will 'from .. import sys' in a
   (single-level) package.

 - 'from __future__ import absolute_import' will turn on the new semantics
   for import and from-import: imports will be absolute, except for
   from-import with dots.

Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
2006-02-28 16:09:29 +00:00
Martin v. Löwis
1d519e4625 unconst. 2006-02-27 23:10:11 +00:00
Thomas Wouters
b9eb5510e6 Convert array.array.insert to use Py_ssize_t (like the rest already does.) 2006-02-27 19:44:56 +00:00
Martin v. Löwis
02cbf4ae4b More unconsting. 2006-02-27 17:20:04 +00:00
Martin v. Löwis
b79afb6e3a unconst. 2006-02-27 17:01:22 +00:00
Martin v. Löwis
15e62742fa Revert backwards-incompatible const changes. 2006-02-27 16:46:16 +00:00
Thomas Wouters
e2dd78c760 Update for PEP 308 patch. 2006-02-27 16:25:11 +00:00
Martin v. Löwis
577b5b960d Create _ast module.
Cleanup Python-ast.c generation.
2006-02-27 15:23:19 +00:00
Guido van Rossum
1968ad32cd - Patch 1433928:
- The copy module now "copies" function objects (as atomic objects).
  - dict.__getitem__ now looks for a __missing__ hook before raising
    KeyError.
  - Added a new type, defaultdict, to the collections module.
    This uses the new __missing__ hook behavior added to dict (see above).
2006-02-25 22:38:04 +00:00
Georg Brandl
c2fb6c74c6 Fix typo in functional module 2006-02-21 17:49:57 +00:00
Guido van Rossum
668a94a34f NETLINK_TCPDIAG and NETLINK_NFLOG aren't defined on older Linux
systems; define these conditionally.
2006-02-21 01:07:27 +00:00
Georg Brandl
e393bf6fe3 Patch #931938: prevent setting sys.prefix to "" 2006-02-20 17:37:36 +00:00
Georg Brandl
dbd8339a01 Bug #854823: socketmodule now builds on Sun platforms even when
INET_ADDRSTRLEN is not defined.
2006-02-20 09:42:33 +00:00
Hye-Shik Chang
d69e034571 Fix a build problem introduced by r42230. 2006-02-19 16:22:22 +00:00
Georg Brandl
e810fe2ca4 Remove two instances of trailing commas. Resolves patch #1209781. 2006-02-19 15:28:47 +00:00
Georg Brandl
e9b1949f70 Patch #1352711: make zipimport raise a complete IOError 2006-02-19 09:38:58 +00:00
Neal Norwitz
093ab1aa03 Remove unused variable 2006-02-18 23:26:27 +00:00
Georg Brandl
f4f4415a18 Patch #1393157: os.startfile() now has an optional argument to specify
a "command verb" to invoke on the file.
2006-02-18 22:29:33 +00:00
Georg Brandl
47fab92542 Bug #1366000: cleanup BZ2File.seek() logic. Fixes the case of whence=2, offset>=0. 2006-02-18 21:57:25 +00:00
Martin v. Löwis
5bb8a15593 Fix typo. 2006-02-18 12:49:49 +00:00
Martin v. Löwis
151860752f Fix size computation on Win64. 2006-02-18 12:38:35 +00:00
Martin v. Löwis
5c97c798d2 Make ssize_t-clean. 2006-02-17 15:49:09 +00:00
Georg Brandl
b86a54f395 Add deprecation warning to modules deprecated since 2000. 2006-02-17 11:29:04 +00:00
Thomas Wouters
2c98a7bbc6 Fix typo. 2006-02-17 09:59:00 +00:00
Georg Brandl
1b6726732c Bug #1432350: arrayobject should use PyObject_VAR_HEAD 2006-02-17 08:56:33 +00:00
Martin v. Löwis
cfe7e0912c Remove size restrictions. 2006-02-17 06:59:14 +00:00
Tim Peters
f28829577d mmap_flush_method(): Squash compiler warning about
mixing signed and unsigned types in comparison.
2006-02-17 01:07:39 +00:00
Tim Peters
8f9cc29e74 Remove space between function name and left paren
in function calls.
2006-02-17 00:00:20 +00:00