Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f6cae0

Browse files
committed
remove magic number bumping from the 2.x -U option #7459
1 parent e8dc258 commit 0f6cae0

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

Python/import.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,23 @@ typedef unsigned short mode_t;
7878
3040 (added signature annotations)
7979
3050 (print becomes a function)
8080
3060 (PEP 3115 metaclass syntax)
81-
3070 (PEP 3109 raise changes)
82-
3080 (PEP 3137 make __file__ and __name__ unicode)
83-
3090 (kill str8 interning)
84-
3100 (merge from 2.6a0, see 62151)
85-
3102 (__file__ points to source file)
86-
Python 3.0a4: 3110 (WITH_CLEANUP optimization).
87-
Python 3.0a5: 3130 (lexical exception stacking, including POP_EXCEPT)
88-
Python 3.1a0: 3140 (optimize list, set and dict comprehensions:
81+
3061 (string literals become unicode)
82+
3071 (PEP 3109 raise changes)
83+
3081 (PEP 3137 make __file__ and __name__ unicode)
84+
3091 (kill str8 interning)
85+
3101 (merge from 2.6a0, see 62151)
86+
3103 (__file__ points to source file)
87+
Python 3.0a4: 3111 (WITH_CLEANUP optimization).
88+
Python 3.0a5: 3131 (lexical exception stacking, including POP_EXCEPT)
89+
Python 3.1a0: 3141 (optimize list, set and dict comprehensions:
8990
change LIST_APPEND and SET_ADD, add MAP_ADD)
90-
Python 3.1a0: 3150 (optimize conditional branches:
91+
Python 3.1a0: 3151 (optimize conditional branches:
9192
introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
9293
Python 3.2a0: 3160 (add SETUP_WITH)
9394
*/
9495

9596
#define MAGIC (3160 | ((long)'\r'<<16) | ((long)'\n'<<24))
96-
/* Magic word as global; note that _PyImport_Init() can change the
97-
value of this global to accommodate for alterations of how the
98-
compiler works which are enabled by command line switches. */
97+
/* Magic word as global */
9998
static long pyc_magic = MAGIC;
10099

101100
/* See _PyImport_FixupExtension() below */
@@ -161,13 +160,6 @@ _PyImport_Init(void)
161160
filetab->suffix = ".pyo";
162161
}
163162
}
164-
165-
{
166-
/* Fix the pyc_magic so that byte compiled code created
167-
using the all-Unicode method doesn't interfere with
168-
code created in normal operation mode. */
169-
pyc_magic = MAGIC + 1;
170-
}
171163
}
172164

173165
void

0 commit comments

Comments
 (0)