Skip to content

Commit 7a237c1

Browse files
committed
remove unused c_encoding struct member
1 parent b879794 commit 7a237c1

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

Python/ast.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ PyAST_Validate(mod_ty mod)
574574

575575
/* Data structure used internally */
576576
struct compiling {
577-
char *c_encoding; /* source encoding */
578577
PyArena *c_arena; /* Arena for allocating memory. */
579578
PyObject *c_filename; /* filename */
580579
PyObject *c_normalize; /* Normalization function from unicodedata. */
@@ -761,23 +760,11 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags,
761760
c.c_arena = arena;
762761
/* borrowed reference */
763762
c.c_filename = filename;
764-
c.c_normalize = c.c_normalize_args = NULL;
765-
if (flags && flags->cf_flags & PyCF_SOURCE_IS_UTF8) {
766-
c.c_encoding = "utf-8";
767-
if (TYPE(n) == encoding_decl) {
768-
#if 0
769-
ast_error(c, n, "encoding declaration in Unicode string");
770-
goto out;
771-
#endif
772-
n = CHILD(n, 0);
773-
}
774-
} else if (TYPE(n) == encoding_decl) {
775-
c.c_encoding = STR(n);
763+
c.c_normalize = NULL;
764+
c.c_normalize_args = NULL;
765+
766+
if (TYPE(n) == encoding_decl)
776767
n = CHILD(n, 0);
777-
} else {
778-
/* PEP 3120 */
779-
c.c_encoding = "utf-8";
780-
}
781768

782769
k = 0;
783770
switch (TYPE(n)) {

0 commit comments

Comments
 (0)