Skip to content

Commit 08d549b

Browse files
HowManyOliversAreTherepi-anl
authored andcommitted
codeop: Initial micropython support.
1 parent 7260247 commit 08d549b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

python-stdlib/codeop/codeop.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
but with 'memory' in the sense described above.
3333
"""
3434

35-
import __future__
35+
# import __future__
3636
import warnings
3737

38-
_features = [getattr(__future__, fname)
39-
for fname in __future__.all_feature_names]
38+
## MPY: Future flags aren’t set on compiled code so just remove the checks
39+
# _features = [getattr(__future__, fname)
40+
# for fname in __future__.all_feature_names]
4041

4142
__all__ = ["compile_command", "Compile", "CommandCompiler"]
4243

@@ -116,9 +117,10 @@ def __init__(self):
116117

117118
def __call__(self, source, filename, symbol):
118119
codeob = compile(source, filename, symbol, self.flags, True)
119-
for feature in _features:
120-
if codeob.co_flags & feature.compiler_flag:
121-
self.flags |= feature.compiler_flag
120+
## MPY: Future flags aren’t set on compiled code so just remove the checks
121+
# for feature in _features:
122+
# if codeob.co_flags & feature.compiler_flag:
123+
# self.flags |= feature.compiler_flag
122124
return codeob
123125

124126
class CommandCompiler:

0 commit comments

Comments
 (0)