diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 3 | ||||
-rw-r--r-- | Python/compile.c | 23 | ||||
-rw-r--r-- | Python/import.c | 2 |
3 files changed, 7 insertions, 21 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 9bcb2ad451..40b5738774 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1165,8 +1165,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals, default: switch (opcode) { #endif - case UNPACK_TUPLE: - case UNPACK_LIST: + case UNPACK_SEQUENCE: v = POP(); if (PyTuple_Check(v)) { if (PyTuple_Size(v) != oparg) { diff --git a/Python/compile.c b/Python/compile.c index 49e5863d03..395bd1e07b 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1729,27 +1729,14 @@ com_assign_trailer(struct compiling *c, node *n, int assigning) } static void -com_assign_tuple(struct compiling *c, node *n, int assigning) +com_assign_sequence(struct compiling *c, node *n, int assigning) { int i; if (TYPE(n) != testlist) REQ(n, exprlist); if (assigning) { i = (NCH(n)+1)/2; - com_addoparg(c, UNPACK_TUPLE, i); - com_push(c, i-1); - } - for (i = 0; i < NCH(n); i += 2) - com_assign(c, CHILD(n, i), assigning); -} - -static void -com_assign_list(struct compiling *c, node *n, int assigning) -{ - int i; - if (assigning) { - i = (NCH(n)+1)/2; - com_addoparg(c, UNPACK_LIST, i); + com_addoparg(c, UNPACK_SEQUENCE, i); com_push(c, i-1); } for (i = 0; i < NCH(n); i += 2) @@ -1775,7 +1762,7 @@ com_assign(struct compiling *c, node *n, int assigning) case exprlist: case testlist: if (NCH(n) > 1) { - com_assign_tuple(c, n, assigning); + com_assign_sequence(c, n, assigning); return; } n = CHILD(n, 0); @@ -1843,7 +1830,7 @@ com_assign(struct compiling *c, node *n, int assigning) "can't assign to []"); return; } - com_assign_list(c, n, assigning); + com_assign_sequence(c, n, assigning); return; case NAME: com_assign_name(c, CHILD(n, 0), assigning); @@ -2869,7 +2856,7 @@ com_fplist(struct compiling *c, node *n) } else { int i = (NCH(n)+1)/2; - com_addoparg(c, UNPACK_TUPLE, i); + com_addoparg(c, UNPACK_SEQUENCE, i); com_push(c, i-1); for (i = 0; i < NCH(n); i += 2) com_fpdef(c, CHILD(n, i)); diff --git a/Python/import.c b/Python/import.c index 3c5f6246e3..9b3094287e 100644 --- a/Python/import.c +++ b/Python/import.c @@ -66,7 +66,7 @@ extern time_t PyOS_GetLastModificationTime(char *, FILE *); /* XXX Perhaps the magic number should be frozen and a version field added to the .pyc file header? */ /* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */ -#define MAGIC (50428 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (50811 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the value of this global to accommodate for alterations of how the |