@@ -77,14 +77,6 @@ typedef struct _PyCfgBuilder cfg_builder;
7777#define LOCATION (LNO , END_LNO , COL , END_COL ) \
7878 ((const _Py_SourceLocation){(LNO), (END_LNO), (COL), (END_COL)})
7979
80- /* Return true if loc1 starts after loc2 ends. */
81- static inline bool
82- location_is_after (location loc1 , location loc2 ) {
83- return (loc1 .lineno > loc2 .end_lineno ) ||
84- ((loc1 .lineno == loc2 .end_lineno ) &&
85- (loc1 .col_offset > loc2 .end_col_offset ));
86- }
87-
8880#define LOC (x ) SRC_LOCATION_FROM_AST(x)
8981
9082typedef _PyJumpTargetLabel jump_target_label ;
@@ -3847,14 +3839,6 @@ compiler_from_import(struct compiler *c, stmt_ty s)
38473839 PyTuple_SET_ITEM (names , i , Py_NewRef (alias -> name ));
38483840 }
38493841
3850- if (location_is_after (LOC (s ), c -> c_future .ff_location ) &&
3851- s -> v .ImportFrom .module && s -> v .ImportFrom .level == 0 &&
3852- _PyUnicode_EqualToASCIIString (s -> v .ImportFrom .module , "__future__" ))
3853- {
3854- Py_DECREF (names );
3855- return compiler_error (c , LOC (s ), "from __future__ imports must occur "
3856- "at the beginning of the file" );
3857- }
38583842 ADDOP_LOAD_CONST_NEW (c , LOC (s ), names );
38593843
38603844 if (s -> v .ImportFrom .module ) {
0 commit comments