summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
Commit message (Collapse)AuthorAgeFilesLines
* On Cygwin, put stdin, stderr, and stdout in binary mode when the -uSjoerd Mullender2002-08-091-2/+2
| | | | flag is given (to mimic native Windows).
* Added one call to Py_Main(), for OSX framework builds only, that will get theJack Jansen2002-08-021-1/+17
| | | | | | | | | | | | | actual script to run in case we are running from an applet. If we are indeed running an applet we skip the normal option processing leaving it all to the applet code. This allows us to get use the normal python binary in the Python.app bundle, giving us all the normal command line options through PythonLauncher while still allowing Python.app to be used as the template for building applets. Consequently, pythonforbundle is gone, and Mac/Python/macmain.c isn't used on OSX anymore.
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Fix last checkin, can't use " inside a stringNeal Norwitz2002-07-281-1/+1
|
* Patch #552812: Better description in "python -h" for -u.Martin v. Löwis2002-07-281-0/+1
|
* OS/2 EMX port changes (Modules part of patch #450267):Andrew MacIntyre2002-03-031-1/+5
| | | | | | | | | | | | | | | Modules/ _hotshot.c dbmmodule.c fcntlmodule.c main.c pwdmodule.c readline.c selectmodule.c signalmodule.c termios.c timemodule.c unicodedata.c
* Remove mentioning of -U option in "python -h" output.Marc-André Lemburg2002-02-111-1/+0
|
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-4/+0
|
* SF bug #488514: -Qnew needs workTim Peters2001-12-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Big Hammer to implement -Qnew as PEP 238 says it should work (a global option affecting all instances of "/"). pydebug.h, main.c, pythonrun.c: define a private _Py_QnewFlag flag, true iff -Qnew is passed on the command line. This should go away (as the comments say) when true division becomes The Rule. This is deliberately not exposed to runtime inspection or modification: it's a one-way one-shot switch to pretend you're using Python 3. ceval.c: when _Py_QnewFlag is set, treat BINARY_DIVIDE as BINARY_TRUE_DIVIDE. test_{descr, generators, zipfile}.py: fiddle so these pass under -Qnew too. This was just a matter of s!/!//! in test_generators and test_zipfile. test_descr was trickier, as testbinop() is passed assumptions that "/" is the same as calling a "__div__" method; put a temporary hack there to call "__truediv__" instead when the method name is "__div__" and 1/2 evaluates to 0.5. Three standard tests still fail under -Qnew (on Windows; somebody please try the Linux tests with -Qnew too! Linux runs a whole bunch of tests Windows doesn't): test_augassign test_class test_coercion I can't stay awake longer to stare at this (be my guest). Offhand cures weren't obvious, nor was it even obvious that cures are possible without major hackery. Question: when -Qnew is in effect, should calls to __div__ magically change into calls to __truediv__? See "major hackery" at tail end of last paragraph <wink>.
* PEP 238 documented -Qwarn as warning only for classic int or longGuido van Rossum2001-09-041-4/+8
| | | | | division, and this makes sense. Add -Qwarnall to warn for all classic divisions, as required by the fixdiv.py tool.
* Rename the -D option to -Q, to avoid a Jython option name conflict.Guido van Rossum2001-09-041-7/+7
|
* Oops. The -W option takes args, not -X.Guido van Rossum2001-08-311-1/+1
|
* Add warning mode for classic division, almost exactly as specified inGuido van Rossum2001-08-311-19/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PEP 238. Changes: - add a new flag variable Py_DivisionWarningFlag, declared in pydebug.h, defined in object.c, set in main.c, and used in {int,long,float,complex}object.c. When this flag is set, the classic division operator issues a DeprecationWarning message. - add a new API PyRun_SimpleStringFlags() to match PyRun_SimpleString(). The main() function calls this so that commands run with -c can also benefit from -Dnew. - While I was at it, I changed the usage message in main() somewhat: alphabetized the options, split it in *four* parts to fit in under 512 bytes (not that I still believe this is necessary -- doc strings elsewhere are much longer), and perhaps most visibly, don't display the full list of options on each command line error. Instead, the full list is only displayed when -h is used, and otherwise a brief reminder of -h is displayed. When -h is used, write to stdout so that you can do `python -h | more'. Notes: - I don't want to use the -W option to control whether the classic division warning is issued or not, because the machinery to decide whether to display the warning or not is very expensive (it involves calling into the warnings.py module). You can use -Werror to turn the warnings into exceptions though. - The -Dnew option doesn't select future division for all of the program -- only for the __main__ module. I don't know if I'll ever change this -- it would require changes to the .pyc file magic number to do it right, and a more global notion of compiler flags. - You can usefully combine -Dwarn and -Dnew: this gives the __main__ module new division, and warns about classic division everywhere else.
* Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer2001-07-231-7/+18
| | | | and PYTHONPATH).
* Add "help" to the things one is encouraged to type for moreGuido van Rossum2001-07-181-1/+2
| | | | information. (I found this idea in the ActivePython 2.1 diffs.)
* Part way to allowing "from __future__ import generators" to communicateTim Peters2001-07-161-1/+1
| | | | | | | | | | that info to code dynamically compiled *by* code compiled with generators enabled. Doesn't yet work because there's still no way to tell the parser that "yield" is OK (unlike nested_scopes, the parser has its fingers in this too). Replaced PyEval_GetNestedScopes by a more-general PyEval_MergeCompilerFlags. Perhaps I should not have? I doubted it was *intended* to be part of the public API, so just did.
* Removed the Python version from the PYTHONHOMEHELP string. It wasMarc-André Lemburg2001-06-121-1/+1
| | | | still set to python2.0 ...
* Updated version of RISCOS support. SF patch 411213 by Dietmar SchwertbergerGuido van Rossum2001-04-101-8/+12
|
* Extend support for from __future__ import nested_scopesJeremy Hylton2001-03-221-3/+8
| | | | | | | | | | | | | | | | | | | If a module has a future statement enabling nested scopes, they are also enable for the exec statement and the functions compile() and execfile() if they occur in the module. If Python is run with the -i option, which enters interactive mode after executing a script, and the script it runs enables nested scopes, they are also enabled in interactive mode. XXX The use of -i with -c "from __future__ import nested_scopes" is not supported. What's the point? To support these changes, many function variants have been added to pythonrun.c. All the variants names end with Flags and they take an extra PyCompilerFlags * argument. It is possible that this complexity will be eliminated in a future version of the interpreter in which nested scopes are not optional.
* RISCOS changes by dschwertberger.Guido van Rossum2001-03-021-0/+23
|
* Py_Main(): When compiled by Insure (i.e. __INSURE__ is defined), callBarry Warsaw2001-02-231-0/+14
| | | | | | | | | the internal API function to release the interned strings as the very last thing before returning status. This aids in memory use debugging because it eliminates a huge source of noise from the reports. This is never called during normal (non-debugging) use because releasing the interned strings slows Python's shutdown and isn't necessary anyway because the system will always reclaim the memory.
* Add a line to "python -h" output about PYTHONCASEOK.Tim Peters2001-02-221-0/+1
|
* Add the -W option.Guido van Rossum2000-12-151-1/+8
|
* Move our own getopt() implementation to _PyOS_GetOpt(), and use itThomas Wouters2000-11-031-16/+12
| | | | | | | | | regardless of whether the system getopt() does what we want. This avoids the hassle with prototypes and externs, and the check to see if the system getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to avoid name clashes. Add new include file to define the right symbols. Fix Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on Python to provide it.
* Py_Main(), usage(), usage_mid: Add -h and -V flags to print the usageBarry Warsaw2000-09-151-8/+32
| | | | | message and Python version number and exit immediately. Closes patch #101496.
* Instead of printing all 9 lines of copyright info, printGuido van Rossum2000-09-051-1/+4
| | | | "Type \"copyright\", \"credits\" or \"license\" for more information."
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),Guido van Rossum2000-08-271-4/+3
| | | | | | | | | | | | | | PyRun_FileEx(). These are the same as their non-Ex counterparts but have an extra argument, a flag telling them to close the file when done. Then this is used by Py_Main() and execfile() to close the file after it is parsed but before it is executed. Adding APIs seems strange given the feature freeze but it's the only way I see to close the bug report without incompatible changes. [ Bug #110616 ] source file stays open after parsing is done (PR#209)
* - changed 1.5 to 2.0 in the help textFredrik Lundh2000-07-091-7/+3
| | | | | | | (the PYTHONHOMEHELP define) - ANSI-fication (patch #100794 by Peter Schneider-Kamp)
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* usage_mid: Remove the description of the -X flag; it's gone now.Barry Warsaw2000-05-021-5/+0
| | | | Py_Main(): Remove the 'X' case.
* Marc-Andre Lemburg:Guido van Rossum2000-05-011-1/+6
| | | | | | | Added -U command line option. With the option enabled the Python compiler interprets all "..." strings as u"..." (same with r"..." and ur"...").
* Patch from Tim Peters to repare a the problem that tracebacks are offGuido van Rossum1999-04-191-2/+9
| | | | by a line when Python is run with -x.
* On Windows, -i shouldn't call set[v]buf(stdin, ...) because it screwsGuido van Rossum1999-02-091-1/+1
| | | | | | up the _tkinter main loop. Not clear why; the _kbhit() call _tkinter makes probably confuses the stdio library when buffering isn't set to whatever it is by default.
* Document -OO; "unsafe" optimization that removes docstrings.Guido van Rossum1999-01-281-1/+2
| | | | Marc-Andre Lemburg.
* Py_Main() must be DL_EXPORT too.Guido van Rossum1998-12-071-1/+1
|
* Documented PYTHONOPTIMIZE; by Marc Lemburg.Guido van Rossum1998-10-071-1/+1
|
* Typo in usage message.Guido van Rossum1998-04-131-1/+1
|
* Add -t option to set the Py_TabcheckFlag flag.Guido van Rossum1998-04-101-5/+10
|
* Don't use setvbuf unless HAVE_SETVBUF is defined.Guido van Rossum1998-03-061-4/+12
|
* Two changes by Jeff Rush (slightly tweaked):Guido van Rossum1997-12-051-9/+26
| | | | | | | | | | | - New option -x, to skip first line of script - Use the correct platform-specific delimiter and library location in the usage message (Also removed two blank lines and moved one line around so that each part of the usage message is again under 512 bytes and the whole usage message still fits in 23 lines.)
* Take out the setlocale() call. It affects atof() and will breakGuido van Rossum1997-10-311-8/+0
| | | | floating point literals. Need to do this differently...
* Add call to setlocale(LC_ALL, "").Guido van Rossum1997-10-081-1/+8
|
* Move the "import readline" to an earlier place so it is also done whenGuido van Rossum1997-09-161-8/+10
| | | | | "-i" is given. (Yes, I know, giving in to Marc Lemburg who wanted this :-)
* Added -X option to suppress default import of site.py. Also split theGuido van Rossum1997-08-291-5/+13
| | | | | usage message in *three* parts under 510 bytes, for low-end ANSI compatibility.
* Swap the sense of the -X option vis-a-vis Py_UseClassExceptionsFlag soBarry Warsaw1997-08-291-2/+3
| | | | | that class based exceptions are enabled by default. -X disables them in favor of the old-style string exceptions.
* Parse new command line option -X which enables exception classes.Barry Warsaw1997-08-291-1/+6
|
* Attempt to import readline at interactive startup.Guido van Rossum1997-08-051-0/+8
|
* Py_Cleanup() is now Py_Finalize().Guido van Rossum1997-08-051-1/+1
|