mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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.
This commit is contained in:
parent
0c4eb62565
commit
6caa07b23d
2 changed files with 8 additions and 46 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue