1. 04 Oct, 2017 5 commits
    • Damien George's avatar
    • Damien George's avatar
      py/mpprint: Only check for null string printing when NDEBUG not defined. · 23faf88c
      Damien George authored
      Printing "(null)" when a NULL string pointer is passed to %s is a debugging
      feature and not a feature that's relied upon by the code.  So it only needs
      to be compiled in when debugging (such as assert) is enabled, and saves
      roughy 30 bytes of code when disabled.
      
      This patch also fixes this NULL check to not do the check if the precision
      is specified as zero.
      23faf88c
    • Damien George's avatar
      py/objstr: Make empty bytes object have a null-terminating byte. · dfa563c7
      Damien George authored
      Because a lot of string processing functions assume there is a null
      terminating byte, so they can work in an efficient way.
      
      Fixes issue #3334.
      dfa563c7
    • Damien George's avatar
      all: Remove inclusion of internal py header files. · a3dc1b19
      Damien George authored
      Header files that are considered internal to the py core and should not
      normally be included directly are:
          py/nlr.h - internal nlr configuration and declarations
          py/bc0.h - contains bytecode macro definitions
          py/runtime0.h - contains basic runtime enums
      
      Instead, the top-level header files to include are one of:
          py/obj.h - includes runtime0.h and defines everything to use the
              mp_obj_t type
          py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
              and defines everything to use the general runtime support functions
      
      Additional, specific headers (eg py/objlist.h) can be included if needed.
      a3dc1b19
    • Damien George's avatar
      py/objtype: Change type of enum-to-qstr table to uint16_t to save space. · 6c82cfc0
      Damien George authored
      Qstr values fit in 16-bits (and this fact is used elsewhere in the code) so
      no need to use more than that for the large lookup tables.  The compiler
      will anyway give a warning if the qstr values don't fit in 16 bits.  Saves
      around 80 bytes of code space for Thumb2 archs.
      6c82cfc0
  2. 03 Oct, 2017 7 commits
  3. 02 Oct, 2017 3 commits
  4. 30 Sep, 2017 1 commit
  5. 26 Sep, 2017 2 commits
    • Damien George's avatar
      py/objfloat: Support raising a negative number to a fractional power. · bdc6e86e
      Damien George authored
      This returns a complex number, following CPython behaviour.  For ports that
      don't have complex numbers enabled this will raise a ValueError which gives
      a fail-safe for scripts that were written assuming complex numbers exist.
      bdc6e86e
    • David Lechner's avatar
      py: Add config option to print warnings/errors to stderr. · 62849b70
      David Lechner authored
      This adds a new configuration option to print runtime warnings and errors to
      stderr. On Unix, CPython prints warnings and unhandled exceptions to stderr,
      so the unix port here is configured to use this option.
      
      The unix port already printed unhandled exceptions on the main thread to
      stderr. This patch fixes unhandled exceptions on other threads and warnings
      (issue #2838) not printing on stderr.
      
      Additionally, a couple tests needed to be fixed to handle this new behavior.
      This is done by also capturing stderr when running tests.
      62849b70
  6. 25 Sep, 2017 4 commits
  7. 24 Sep, 2017 1 commit
    • Paul Sokolovsky's avatar
      extmod/re1.5: Update to 0.8.1. · 4a314a6f
      Paul Sokolovsky authored
      Allow literal minus in char classes to be in trailing position, e.g. [a-c-].
      (Previously, minus was allowed only at the start.)
      
      This increases ARM Thumb2 code size by 8 bytes.
      4a314a6f
  8. 22 Sep, 2017 5 commits
  9. 21 Sep, 2017 11 commits
  10. 20 Sep, 2017 1 commit