summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* comples_from_string(): Move s_buffer[] up to the top-level functionBarry Warsaw2000-08-181-2/+1
| | | | | | scope. Previously, s_buffer[] was defined inside the PyUnicode_Check() scope, but referred to in the outer scope via assignment to s. This quiets an Insure portability warning.
* Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters2000-08-174-690/+793
| | | | | | | | name as n'. By doing some twists and turns, "as" is not a reserved word. There is a slight change in semantics for 'from module import name' (it will now honour the 'global' keyword) but only in cases that are explicitly undocumented.
* _PySys_Init(): Fix another Insure discovered memory leak; the PyStringBarry Warsaw2000-08-161-1/+2
| | | | created from the "big"/"little" constant needs to be decref'd.
* SyntaxError__str__(): Fix two memory problems discovered by Insure.Barry Warsaw2000-08-161-4/+9
| | | | | | | First, the allocated buffer was never freed after using it to create the PyString object. Second, it was possible that have_filename would be false (meaning that filename was not a PyString object), but that the code would still try to PyString_GET_SIZE() it.
* Fix new compiler warnings. Unused var in compile.c. Argsize mismatchesTim Peters2000-08-151-1/+0
| | | | | | in binascii.c (only on platforms with signed chars -- although Py_CHARMASK is documented as returning an int, it only does so on platforms with signed chars).
* my_basename(): Removes the leading path components from a path name,Fred Drake2000-08-151-2/+23
| | | | | | | | returning a pointer to the start of the file's "base" name; similar to os.path.basename(). SyntaxError__str__(): Use my_basename() to keep the length of the file name included in the exception message short.
* Remove the osdefs.h #include; it was not needed in the final version ofFred Drake2000-08-152-2/+0
| | | | my last set of changes.
* When raising a SyntaxError, make a best-effort attempt to set theFred Drake2000-08-151-9/+29
| | | | | | | | | | filename and lineno attributes, but do not mask the SyntaxError if we fail. This is part of what is needed to close SoruceForge bug #110628 (Jitterbug PR#278). Wrap a long line to fit in under 80 columns.
* When raising a SyntaxError, make a best-effort attempt to set theFred Drake2000-08-151-1/+19
| | | | | | | | filename and lineno attributes, but do not mask the SyntaxError if we fail. This is part of what is needed to close SoruceForge bug #110628 (Jitterbug PR#278).
* SyntaxError__str__(): Do more formatting of the exception here, ratherFred Drake2000-08-151-6/+55
| | | | | | | | | than depending on the site that raises the exception. If the filename and lineno attributes are set on the exception object, use them to augment the message displayed. This is part of what is needed to close SoruceForge bug #110628 (Jitterbug PR#278).
* Guido pointed out that all names in the sys module have no underscore,Fred Drake2000-08-151-4/+5
|
* Fix the parent of WindowsError - both the comments in this source file, and ↵Mark Hammond2000-08-151-1/+1
| | | | the previous exceptions.py have WindowsError as a sub-class of OSError.
* The attempt to protect against MS_WIN16 compilers that do not support longFred Drake2000-08-141-1/+2
| | | | | | string literals has not been tested on an MS_WIN16 platform; the trailing ";" was inside the #ifndef MS_WIN16, which should cause an error (missing semi-colon) when compiled with that symbol #defined.
* Add a byte_order value to the sys module. The value is "big" forFred Drake2000-08-141-0/+13
| | | | big-endian machines and "little" for little-endian machines.
* The list comp patch checked for the second child node of the 'listmaker'Thomas Wouters2000-08-131-1/+1
| | | | | node, without checking if the node actually had more than one child. It can have only one node, though: '[' test ']'. This fixes it.
* The list comprehensions patch partly reversed the removal of UNPACK_LIST,Thomas Wouters2000-08-121-13/+0
| | | | re-introducing com_assign_list, now unused. Removed it.
* Clean up a couple of warnings on Win64. The downcast of the strlen size_tTrent Mick2000-08-121-1/+1
| | | | | return value to int is safe here because in each case it previouls checked that there will be no overflow.
* list comprehensions. seeSkip Montanaro2000-08-122-215/+425
| | | | | | http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470 for details.
* Merge UNPACK_LIST and UNPACK_TUPLE into a single UNPACK_SEQUENCE, since theyThomas Wouters2000-08-113-21/+7
| | | | | | | did the same anyway. I'm not sure what to do with Tools/compiler/compiler/* -- that isn't part of distutils, is it ? Should it try to be compatible with old bytecode version ?
* -- from Trent Mick: [Patch #101010] replace use of INT_PTRFredrik Lundh2000-08-071-5/+1
| | | | with uintptr_t (fix MSVC 5.0 build)
* When returning an error from jcompile() (which is passed through byGuido van Rossum2000-08-071-0/+8
| | | | | PyNode_Compile()), make sure that an exception is actually set -- otherwise someone stomped on our error. [2.0 checkin of this fix.]
* Avoid dumping core when PyErr_NormalizeException() is called withoutGuido van Rossum2000-08-071-0/+6
| | | | an exception set. This shouldn't happen, but we see it at times...
* Initialized opcode and oparg to silence a gcc -Wall warning.Moshe Zadka2000-08-071-2/+2
|
* Fix some strange indentation and grammar that have been bugging me forThomas Wouters2000-08-051-6/+5
| | | | weeks.
* Changed H specifier to mean "bitfield", i.e. any value fromJack Jansen2000-08-051-5/+27
| | | | | | -32768..65535 is acceptable. Added B specifier (with values from -128..255). No L added (which would have completed the set) because l already accepts any value (and the letter L is taken for quadwords).
* Removing warnings by gcc -Wall -- cast ugly || to void.Moshe Zadka2000-08-041-1/+1
|
* Add a test that Py_IsInitialized() in Py_InitModule4(). SeeGuido van Rossum2000-08-041-0/+2
| | | | | | | python-dev discussion. This should catch future version incompatibilities on Windows. Alas, this doesn't help for 1.5 vs. 1.6; but it will help for 1.6 vs. 2.0.
* This patch finalizes the move from UTF-8 to a default encoding inMarc-André Lemburg2000-08-031-4/+6
| | | | | | | | | | | | | | | | | | the Python Unicode implementation. The internal buffer used for implementing the buffer protocol is renamed to defenc to make this change visible. It now holds the default encoded version of the Unicode object and is calculated on demand (NULL otherwise). Since the default encoding defaults to ASCII, this will mean that Unicode objects which hold non-ASCII characters will no longer work on C APIs using the "s" or "t" parser markers. C APIs must now explicitly provide Unicode support via the "u", "U" or "es"/"es#" parser markers in order to work with non-ASCII Unicode strings. (Note: this patch will also have to be applied to the 1.6 branch of the CVS tree.)
* Changing the CNRI copyright notice according to CNRI's instructions.Guido van Rossum2000-08-031-1/+1
| | | | | This is a notice without a date, which apparently is not a claim to copyright but only advice to the reader. IANAL. :-)
* Both PEP 201 Lockstep Iteration and SF patch #101030 have beenBarry Warsaw2000-08-031-0/+56
| | | | | | | | | | | accepted by the BDFL. builtin_zip(): New function to implement the zip() function described in the above proposal. zip_doc[]: Docstring for zip(). builtin_methods[]: added entry for zip()
* Include the dependence of sysmodule on the patchlevel.h include, soFred Drake2000-08-011-1/+1
| | | | that sys.version_info will be built properly.
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-313-5/+2
| | | | marked my*.h as obsolete
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-251-5/+5
| | | | Leave the actual #define in for API compatibility.
* Create a new section of pyport.h to hold all external function declarationsThomas Wouters2000-07-241-1/+0
| | | | | | | | | | | | | | for systems that are missing those declarations from system include files. Start by moving a pointy-haired ones from their previous locations to the new section. (The gethostname() one, for instance, breaks on several systems, because some define it as (char *, size_t) and some as (char *, int).) I purposely decided not to include the summary of used #defines like Tim did in the first section of pyport.h. In my opinion, the number of #defines likedly to be used by this section would make such an overview unwieldy. I would suggest documenting the non-obvious ones, though.
* Prototype yet another forward declaration.Thomas Wouters2000-07-241-1/+1
|
* Another missed ansification.Thomas Wouters2000-07-231-4/+1
|
* Included assert.h in Python.h -- it's absurd that this basic tool ofTim Peters2000-07-231-1/+1
| | | | | | | | good C practice hasn't been available to everything all along. Added Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) macro to pyport.h; this just casts VALUE from type WIDE to type NARROW, but assert-fails if Py_DEBUG is defined and info is lost due to casting. Replaced a line in Fredrik's fix to marshal.c to use the new macro.
* -- changed w_more to take an integer instead of a charFredrik Lundh2000-07-231-2/+2
| | | | (this is what the callers expect).
* Oops. One of last nights ANSIfication patches accidentily upped the bytecodeThomas Wouters2000-07-231-1/+1
| | | | | | MAGIC number. When updating it next time, be sure it's higher than 50715 * constants. (Shouldn't be a problem if everyone keeps to the proper algorithm.)
* ANSIfy as many declarations as possible.Thomas Wouters2000-07-225-7/+8
|
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-2245-1526/+704
| | | | declarations yet, those come later.
* Fix two instances of empty argument lists, and fix styleThomas Wouters2000-07-221-79/+78
| | | | ('PyObject** x' -> 'PyObject **x')
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-1610-11/+11
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* just fixing the indentationPeter Schneider-Kamp2000-07-131-1/+1
|
* raise error on duplicate function argumentsPeter Schneider-Kamp2000-07-131-1/+10
| | | | | | | | example: >>> def f(a,a):print a ... SyntaxError: duplicate argument in function definition
* delete obsolete SYMANTEC__CFM68K__ #ifdefsSkip Montanaro2000-07-122-8/+0
|
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-123-10/+11
|
* Worm around MSVC6 error on single string literal > 2Kb.Tim Peters2000-07-121-2/+7
|
* Include macglue.h for some function prototypes, and renamed a fewJack Jansen2000-07-113-3/+10
| | | | mac-specific functions to have a PyMac_ name.
* Create two new exceptions: IndentationError and TabError. These areFred Drake2000-07-112-4/+42
| | | | | | | used for indentation related errors. This patch includes Ping's improvements for indentation-related error messages. Closes SourceForge patches #100734 and #100856.