kopia lustrzana https://github.com/micropython/micropython-lib
codeop: Initial micropython support.
rodzic
ae19d103b3
commit
7444302ac6
|
@ -32,11 +32,12 @@ Compile():
|
||||||
but with 'memory' in the sense described above.
|
but with 'memory' in the sense described above.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import __future__
|
# import __future__
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
_features = [getattr(__future__, fname)
|
## MPY: Future flags aren’t set on compiled code so just remove the checks
|
||||||
for fname in __future__.all_feature_names]
|
# _features = [getattr(__future__, fname)
|
||||||
|
# for fname in __future__.all_feature_names]
|
||||||
|
|
||||||
__all__ = ["compile_command", "Compile", "CommandCompiler"]
|
__all__ = ["compile_command", "Compile", "CommandCompiler"]
|
||||||
|
|
||||||
|
@ -116,9 +117,10 @@ class Compile:
|
||||||
|
|
||||||
def __call__(self, source, filename, symbol):
|
def __call__(self, source, filename, symbol):
|
||||||
codeob = compile(source, filename, symbol, self.flags, True)
|
codeob = compile(source, filename, symbol, self.flags, True)
|
||||||
for feature in _features:
|
## MPY: Future flags aren’t set on compiled code so just remove the checks
|
||||||
if codeob.co_flags & feature.compiler_flag:
|
# for feature in _features:
|
||||||
self.flags |= feature.compiler_flag
|
# if codeob.co_flags & feature.compiler_flag:
|
||||||
|
# self.flags |= feature.compiler_flag
|
||||||
return codeob
|
return codeob
|
||||||
|
|
||||||
class CommandCompiler:
|
class CommandCompiler:
|
||||||
|
|
Ładowanie…
Reference in New Issue