annotate Python/getversion.c @ 16357:9f2ca855fa44 legacy-trunk

Enforce two illegal import statements that were outlawed in the reference manual but not checked: Names bound by import statemants may not occur in global statements in the same scope. The from ... import * form may only occur in a module scope. I guess these changes could break code, but the reference manual warned about them. Several other small changes If a variable is declared global in the nearest enclosing scope of a free variable, then treat it is a global in the nested scope too. Get rid of com_mangle and symtable_mangle functions and call mangle directly. If errors occur during symtable table creation, return -1 from symtable_build(). Do not increment st_errors in assignment to lambda, because exception is not set. Add extra argument to symtable_assign(); the argument, flag, is ORed with DEF_LOCAL for each symtable_add_def() call.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Tue, 30 Jan 2001 01:24:43 +0000
parents 6f6f965c5e2d
children 379fc66f4c96
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3212
diff changeset
1
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Return the full version string. */
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
3101
237c3b2a6187 include Python.h
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
4 #include "Python.h"
237c3b2a6187 include Python.h
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
5
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 #include "patchlevel.h"
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 const char *
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13256
diff changeset
9 Py_GetVersion(void)
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 {
10668
8c6ffe670963 Allow longer strings (up to 80 chars each) for version, build,
Guido van Rossum <guido@python.org>
parents: 9970
diff changeset
11 static char version[250];
8c6ffe670963 Allow longer strings (up to 80 chars each) for version, build,
Guido van Rossum <guido@python.org>
parents: 9970
diff changeset
12 sprintf(version, "%.80s (%.80s) %.80s", PY_VERSION,
9745
6fc58d79dac5 Use PY_VERSION instead of PATCHLEVEL.
Guido van Rossum <guido@python.org>
parents: 5860
diff changeset
13 Py_GetBuildInfo(), Py_GetCompiler());
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 return version;
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 }