diff options
author | Thomas Wouters <thomas@python.org> | 2006-04-14 11:33:28 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-04-14 11:33:28 (GMT) |
commit | 6caa07b23d4f838d00a9d27efc76e412549b1de9 (patch) | |
tree | 57e24f2c675a2408e0f036a80a94e999a6105596 /Parser/parsetok.c | |
parent | 0c4eb625656a8b8169e599452e271317863d0c7e (diff) | |
download | cpython-6caa07b23d4f838d00a9d27efc76e412549b1de9.zip cpython-6caa07b23d4f838d00a9d27efc76e412549b1de9.tar.gz cpython-6caa07b23d4f838d00a9d27efc76e412549b1de9.tar.bz2 |
Make 'python -tt' the default, meaning Python won't allow mixing tabs and
spaces for indentation. Adds a '-ttt' option to turn the errors back into
warnings; I'm not yet sure whether that's desireable for Py3K.
Also remove the magic for setting the size of tabs based on emacs/vim-style
comments. Python now always considers tabstops to be every-8-spaces.
Diffstat (limited to 'Parser/parsetok.c')
-rw-r--r-- | Parser/parsetok.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c index d877fc9..dbac6e3 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -47,11 +47,8 @@ PyParser_ParseStringFlagsFilename(const char *s, const char *filename, } tok->filename = filename ? filename : "<string>"; - if (Py_TabcheckFlag || Py_VerboseFlag) { - tok->altwarning = (tok->filename != NULL); - if (Py_TabcheckFlag >= 2) - tok->alterror++; - } + if (Py_TabcheckFlag >= 3) + tok->alterror = 0; return parsetok(tok, g, start, err_ret, flags); } @@ -79,12 +76,8 @@ PyParser_ParseFileFlags(FILE *fp, const char *filename, grammar *g, int start, return NULL; } tok->filename = filename; - if (Py_TabcheckFlag || Py_VerboseFlag) { - tok->altwarning = (filename != NULL); - if (Py_TabcheckFlag >= 2) - tok->alterror++; - } - + if (Py_TabcheckFlag >= 3) + tok->alterror = 0; return parsetok(tok, g, start, err_ret, flags); } |