diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-02-26 07:25:14 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-02-26 07:25:14 (GMT) |
commit | 9d66d4af06ad15226b271988cd7f5d0c681924af (patch) | |
tree | 5ef4d6bc6b01ddfcd14b541f8b5a13c7f388daff /Python/ast.c | |
parent | 768921cf3360822dc252d7e295e94960afa9feee (diff) | |
download | cpython-9d66d4af06ad15226b271988cd7f5d0c681924af.zip cpython-9d66d4af06ad15226b271988cd7f5d0c681924af.tar.gz cpython-9d66d4af06ad15226b271988cd7f5d0c681924af.tar.bz2 |
remove unused c_encoding struct member
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/Python/ast.c b/Python/ast.c index ba6b4ba..ad771cf 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -574,7 +574,6 @@ PyAST_Validate(mod_ty mod) /* Data structure used internally */ struct compiling { - char *c_encoding; /* source encoding */ PyArena *c_arena; /* Arena for allocating memory. */ PyObject *c_filename; /* filename */ PyObject *c_normalize; /* Normalization function from unicodedata. */ @@ -761,23 +760,11 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, c.c_arena = arena; /* borrowed reference */ c.c_filename = filename; - c.c_normalize = c.c_normalize_args = NULL; - if (flags && flags->cf_flags & PyCF_SOURCE_IS_UTF8) { - c.c_encoding = "utf-8"; - if (TYPE(n) == encoding_decl) { -#if 0 - ast_error(c, n, "encoding declaration in Unicode string"); - goto out; -#endif - n = CHILD(n, 0); - } - } else if (TYPE(n) == encoding_decl) { - c.c_encoding = STR(n); + c.c_normalize = NULL; + c.c_normalize_args = NULL; + + if (TYPE(n) == encoding_decl) n = CHILD(n, 0); - } else { - /* PEP 3120 */ - c.c_encoding = "utf-8"; - } k = 0; switch (TYPE(n)) { |