| Commit message (Collapse) | Author | Age |
|
|
|
| |
One can instead lookup __name__ in the modules dict to get the value.
|
|
|
|
|
| |
With this patch the n_args parameter is changed type from mp_uint_t to
size_t.
|
| |
|
|
|
|
| |
Based on similar usage for sys.argv/sys.path.
|
|
|
|
|
| |
This for example will allow people to reload modules which didn't load
successfully (e.g. due to syntax error).
|
|
|
|
|
|
|
|
|
| |
This allows the mp_obj_t type to be configured to something other than a
pointer-sized primitive type.
This patch also includes additional changes to allow the code to compile
when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
mp_uint_t, and various casts.
|
| |
|
| |
|
| |
|
|
|
|
| |
Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
|
|
|
|
|
|
| |
The implementation is very basic and non-compliant and provided solely for
CPython compatibility. The function itself is bad Python2 heritage, its
usage is discouraged.
|
|
|
|
| |
Uses attrtuple if it's enabled, otherwise just a normal tuple.
|
|
|
|
|
| |
So now all printing should go via either mp_plat_print or
mp_sys_stdout_print.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous to this patch the printing mechanism was a bit of a tangled
mess. This patch attempts to consolidate printing into one interface.
All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf. All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.
Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform. The former is only used when MICROPY_PY_IO is defined.
With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...). Code size is also reduced by around 200 bytes on
Thumb2 archs.
|
|
|
|
|
| |
Fixes msvc linker warnings about mismatching sizes between the mp_obj_fdfile_t
struct defined in file.c and the mp_uint_t declarations found in modsys.c and modbuiltins.c
|
|
|
|
|
| |
Without mp_sys_path and mp_sys_argv in the root pointer section of the
state, their memory was being incorrectly collected by GC.
|
| |
|
|
|
|
| |
Addresses issue #1022.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function is modeled after traceback.print_exception(), but unbloated,
and put into existing module to save overhead on adding another module.
Compliant traceback.print_exception() is intended to be implemented in
micropython-lib in terms of sys.print_exception().
This change required refactoring mp_obj_print_exception() to take pfenv_t
interface arguments.
Addresses #751.
|
|
|
|
|
| |
This is just a clean-up of the code. Generated code is exactly the
same.
|
|
|
|
|
|
|
|
| |
sys.exit always raises SystemExit so doesn't need a special
implementation for each port. If C exit() is really needed, use the
standard os._exit function.
Also initialise mp_sys_path and mp_sys_argv in teensy port.
|
| |
|
| |
|
|
|
|
|
| |
And not system printf(), like it was before. For this, move pfenv_printf()
from stmhal port to py/.
|
|
|
|
|
| |
Implementing it as a static constant is a bit peculiar and require cooperation
from long int implementation.
|
|
|
|
|
|
| |
It defines types used by all other headers.
Fixes #691.
|
| |
|
|
|
|
|
| |
Ports which wants to have it, should define MICROPY_PY_SYS_PLATFORM to a
string value they need.
|
|
|
|
| |
Now of the form MICROPY_PY_*. See issue #35.
|
|
|
|
| |
For consistency with MICROPY_MOD_SYS_STDFILES, etc.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
|
| |
|
|
|
|
|
|
|
|
| |
The logic appears to be that (at least beginning of) sys.versions is the
version of reference Python language implemented, not version of particular
implementation.
Also, bump set versions at 3.4.0, based on @dpgeorge preference.
|
| |
|
| |
|
| |
|
|
|