From 2dd33e3a8d070ce8279cd7b48a2ddf1143f9ea71 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Jun 2025 21:53:41 -0400 Subject: [PATCH] wip: ports compile and pass smoke tests tests/ not run yet. Reduced some differences from upstream by changing some error messages and defining some preprocessor macros. --- .gitignore | 1 + lib/libm/libm.h | 5 + locale/ID.po | 20 +- locale/circuitpython.pot | 40 +- locale/cs.po | 14 +- locale/de_DE.po | 22 +- locale/el.po | 14 +- locale/en_GB.po | 36 +- locale/en_US.po | 12 +- locale/en_x_pirate.po | 12 +- locale/es.po | 22 +- locale/fil.po | 20 +- locale/fr.po | 22 +- locale/hi.po | 12 +- locale/it_IT.po | 22 +- locale/ja.po | 16 +- locale/ko.po | 16 +- locale/nl.po | 22 +- locale/pl.po | 20 +- locale/pt_BR.po | 22 +- locale/ru.po | 14 +- locale/sv.po | 22 +- locale/tr.po | 14 +- locale/zh_Latn_pinyin.po | 22 +- ports/unix/coveragecpp.cpp | 18 +- ports/unix/mpconfigport.h | 5 +- .../unix/variants/coverage/mpconfigvariant.h | 1 + py/mpconfig.h | 10 + py/mpstate.h | 4 +- py/nlr.c | 3 +- py/nlr.h | 47 +- py/nlraarch64.c | 3 +- py/nlrmips.c | 3 +- py/nlrpowerpc.c | 3 +- py/nlrthumb.c | 3 +- py/nlrx64.c | 3 +- py/nlrx86.c | 6 +- py/nlrxtensa.c | 3 +- py/objstr.c | 15 +- py/objtype.c | 411 ++++++++++-------- py/runtime.c | 19 +- shared-module/atexit/__init__.c | 2 +- tests/micropython/native_with.py.exp | 2 +- tests/micropython/viper_with.py.exp | 2 +- 44 files changed, 534 insertions(+), 471 deletions(-) diff --git a/.gitignore b/.gitignore index 56f843cc9f..fa66711db7 100644 --- a/.gitignore +++ b/.gitignore @@ -102,6 +102,7 @@ TAGS .cache **/CLAUDE.local.md +.claude # windsurf rules .windsurfrules diff --git a/lib/libm/libm.h b/lib/libm/libm.h index 78de4c3ee4..75a2a775f8 100644 --- a/lib/libm/libm.h +++ b/lib/libm/libm.h @@ -19,6 +19,11 @@ #include #include +// CIRCUITPY-CHANGE: prevent undefined warnings +#ifndef FLT_EVAL_METHOD +#define FLT_EVAL_METHOD 0 +#endif + // These lines verify that FLT_EVAL_METHOD==0, MicroPython's libm requires this. // If compilation fails here then check the host compiler's FLT_EVAL_METHOD. typedef float float_t; diff --git a/locale/ID.po b/locale/ID.po index 0eedaf0786..ad814246a6 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -321,7 +321,7 @@ msgid "'%q' object does not support '%q'" msgstr "Objek '%q' tidak mendukung '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "Objek '%q' bukan merupakan iterator" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -329,7 +329,7 @@ msgid "'%q' object is not callable" msgstr "Objek '%q' tidak dapat dipanggil" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "Objek '%q' tidak dapat diulang" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3193,7 +3193,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3652,7 +3652,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4293,11 +4293,11 @@ msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c @@ -4710,13 +4710,13 @@ msgstr "Zi harus berbentuk (n_section, 2)" #~ msgid "'%s' object does not support item deletion" #~ msgstr "Objek '%s' tidak mendukung penghapusan item" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "Objek '%s' bukan iterator" #~ msgid "'%s' object is not callable" #~ msgstr "Objek '%s' tidak dapat dipanggil" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' objek tidak dapat diulang" #~ msgid "'%s' object is not subscriptable" @@ -5526,7 +5526,7 @@ msgstr "Zi harus berbentuk (n_section, 2)" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "frekuensi hanya bisa didefinisikan 80Mhz atau 160Mhz" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "fungsi tidak dapat mengambil argumen keyword" #~ msgid "impossible baudrate" @@ -5581,7 +5581,7 @@ msgstr "Zi harus berbentuk (n_section, 2)" #~ msgid "name must be a string" #~ msgstr "keyword harus berupa string" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "nama digunakan kembali untuk argumen" #~ msgid "non-keyword arg after */**" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 00afd0077b..47dd75f586 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -69,7 +69,7 @@ msgstr "" #: py/objstr.c #, c-format -msgid "%%c requires int or char" +msgid "%%c needs int or char" msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c @@ -309,15 +309,15 @@ msgid "'%q' object does not support '%q'" msgstr "" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c -msgid "'%q' object is not callable" +msgid "'%q' object isn't callable" msgstr "" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -2728,6 +2728,10 @@ msgstr "" msgid "can't convert to str implicitly" msgstr "" +#: py/objtype.c +msgid "can't create '%q' instances" +msgstr "" + #: py/compile.c msgid "can't declare nonlocal in outer code" msgstr "" @@ -2826,10 +2830,6 @@ msgstr "" msgid "cannot convert complex type" msgstr "" -#: py/objtype.c -msgid "cannot create '%q' instances" -msgstr "" - #: py/objtype.c msgid "cannot create instance" msgstr "" @@ -3144,7 +3144,15 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" +msgstr "" + +#: py/objstr.c +msgid "format string didn't convert all arguments" +msgstr "" + +#: py/objstr.c +msgid "format string needs more arguments" msgstr "" #: py/objdeque.c @@ -3603,7 +3611,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -3712,14 +3720,6 @@ msgstr "" msgid "not a constant" msgstr "" -#: py/objstr.c -msgid "not all arguments converted during string formatting" -msgstr "" - -#: py/objstr.c -msgid "not enough arguments for format string" -msgstr "" - #: extmod/ulab/code/numpy/carray/carray_tools.c msgid "not implemented for complex dtype" msgstr "" @@ -4236,11 +4236,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c diff --git a/locale/cs.po b/locale/cs.po index f9e5f9f670..fcf918bbb1 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -320,7 +320,7 @@ msgid "'%q' object does not support '%q'" msgstr "Objekt '%q' nepodporuje '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "Objekt '%q' není iterátor" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -328,7 +328,7 @@ msgid "'%q' object is not callable" msgstr "Objekt '%q' nelze zavolat" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "Objekt '%q' není iterovatelný" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3173,7 +3173,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3632,7 +3632,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4273,11 +4273,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c @@ -4703,7 +4703,7 @@ msgstr "" #~ msgid "'continue' outside loop" #~ msgstr "'continue' je volán mimo cyklus" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "Objekt 'coroutine' není iterátor" #~ msgid "64 bit types" diff --git a/locale/de_DE.po b/locale/de_DE.po index 8d509153cb..e35c06e5e8 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -324,7 +324,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' Objekt unterstützt '%q' nicht" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "'%q' Objekt ist kein Iterator" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -332,7 +332,7 @@ msgid "'%q' object is not callable" msgstr "'%q' Objekt ist kein callable" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "'%q' Objekt ist nicht iterierbar" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3217,7 +3217,7 @@ msgid "format" msgstr "Format" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "Format erfordert ein Wörterbuch (dict)" #: py/objdeque.c @@ -3684,7 +3684,7 @@ msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "Name '%q' ist nirgends definiert worden (Schreibweise kontrollieren)" #: py/runtime.c @@ -4331,11 +4331,11 @@ msgid "tx and rx cannot both be None" msgstr "tx und rx können nicht beide None sein" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "Typ '%q' ist kein akzeptierter Basis-Typ" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/runtime.c @@ -4892,13 +4892,13 @@ msgstr "zi muss die Form (n_section, 2) haben" #~ msgid "'%s' object does not support item deletion" #~ msgstr "'%s' Objekt unterstützt das Löschen von Elementen nicht" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "'%s' Objekt ist kein Iterator" #~ msgid "'%s' object is not callable" #~ msgstr "'%s' object ist nicht aufrufbar" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' Objekt nicht iterierbar" #~ msgid "'%s' object is not subscriptable" @@ -4917,7 +4917,7 @@ msgstr "zi muss die Form (n_section, 2) haben" #~ msgid "'continue' outside loop" #~ msgstr "'continue' außerhalb einer Schleife" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "'coroutine' Objekt ist kein Iterator" #~ msgid "(x,y) integers required" @@ -6287,7 +6287,7 @@ msgstr "zi muss die Form (n_section, 2) haben" #~ msgid "frequency is read-only for this board" #~ msgstr "Frequenz ist für dieses Board schreibgeschützt" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "Funktion akzeptiert keine Schlüsselwort-Argumente" #~ msgid "function is implemented for scalars and ndarrays only" @@ -6401,7 +6401,7 @@ msgstr "zi muss die Form (n_section, 2) haben" #~ msgid "name must be a string" #~ msgstr "name muss ein String sein" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "Name für Argumente wiederverwendet" #~ msgid "no available NIC" diff --git a/locale/el.po b/locale/el.po index 8eb66311bd..8b7a90f52c 100644 --- a/locale/el.po +++ b/locale/el.po @@ -324,7 +324,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' αντικείμενο δεν υποστηρίζει '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "'%q' αντικείμενο δεν είναι επαναλήπτης" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -332,7 +332,7 @@ msgid "'%q' object is not callable" msgstr "'%q' αντικείμενο δεν καλείται" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "'%q' αντικείμενο δεν είναι επαναληπτικό" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3172,7 +3172,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3631,7 +3631,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4272,11 +4272,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c @@ -4600,7 +4600,7 @@ msgstr "" #~ msgid "'continue' outside loop" #~ msgstr "'continue' εκτός επανάληψης" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "" #~ "'coroutine' αντικείμενο δεν μπορεί να χρησιμοποιηθεί σαν επαναλήπτης" diff --git a/locale/en_GB.po b/locale/en_GB.po index f62a09e1db..7ad6d5c009 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -322,16 +322,16 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' object does not support '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" -msgstr "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" +msgstr "'%q' object isn't an iterator" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "'%q' object is not callable" #: py/runtime.c -msgid "'%q' object is not iterable" -msgstr "'%q' object is not iterable" +msgid "'%q' object isn't iterable" +msgstr "'%q' object isn't iterable" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -3180,8 +3180,8 @@ msgid "format" msgstr "format" #: py/objstr.c -msgid "format requires a dict" -msgstr "format requires a dict" +msgid "format needs a dict" +msgstr "format needs a dict" #: py/objdeque.c msgid "full" @@ -3639,8 +3639,8 @@ msgid "must use keyword argument for key function" msgstr "must use keyword argument for key function" #: py/runtime.c -msgid "name '%q' is not defined" -msgstr "name '%q' is not defined" +msgid "name '%q' isn't defined" +msgstr "name '%q' isn't defined" #: py/runtime.c msgid "name not defined" @@ -4280,12 +4280,12 @@ msgid "tx and rx cannot both be None" msgstr "tx and rx cannot both be None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" -msgstr "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" +msgstr "type '%q' isn't an acceptable base type" #: py/objtype.c -msgid "type is not an acceptable base type" -msgstr "type is not an acceptable base type" +msgid "type isn't an acceptable base type" +msgstr "type isn't an acceptable base type" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" @@ -4808,8 +4808,8 @@ msgstr "zi must be of shape (n_section, 2)" #~ msgid "'continue' outside loop" #~ msgstr "'continue' outside loop" -#~ msgid "'coroutine' object is not an iterator" -#~ msgstr "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" +#~ msgstr "'coroutine' object isn't an iterator" #~ msgid "(x,y) integers required" #~ msgstr "(x,y) integers required" @@ -5679,8 +5679,8 @@ msgstr "zi must be of shape (n_section, 2)" #~ msgid "first argument must be an iterable" #~ msgstr "first argument must be an iterable" -#~ msgid "function does not take keyword arguments" -#~ msgstr "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" +#~ msgstr "function doesn't take keyword arguments" #~ msgid "incompatible native .mpy architecture" #~ msgstr "incompatible native .mpy architecture" @@ -5745,8 +5745,8 @@ msgstr "zi must be of shape (n_section, 2)" #~ msgid "maximum number of dimensions is 4" #~ msgstr "maximum number of dimensions is 4" -#~ msgid "name reused for argument" -#~ msgstr "name reused for argument" +#~ msgid "argument name reused" +#~ msgstr "argument name reused" #~ msgid "no available NIC" #~ msgstr "no available NIC" diff --git a/locale/en_US.po b/locale/en_US.po index e9344480c7..f621d0aa19 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -274,7 +274,7 @@ msgid "'%q' object does not support '%q'" msgstr "" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -282,7 +282,7 @@ msgid "'%q' object is not callable" msgstr "" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3068,7 +3068,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3538,7 +3538,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4166,11 +4166,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index f7b682d562..17cac9cb0f 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -274,7 +274,7 @@ msgid "'%q' object does not support '%q'" msgstr "" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -282,7 +282,7 @@ msgid "'%q' object is not callable" msgstr "" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3070,7 +3070,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3540,7 +3540,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4168,11 +4168,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c diff --git a/locale/es.po b/locale/es.po index 065782c2b0..aba7a86adf 100644 --- a/locale/es.po +++ b/locale/es.po @@ -324,7 +324,7 @@ msgid "'%q' object does not support '%q'" msgstr "objeto '%q' no tiene capacidad '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "objeto '%q' no es un iterador" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -332,7 +332,7 @@ msgid "'%q' object is not callable" msgstr "objeto '%q' no es llamable" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "objeto '%q' no es iterable" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3221,7 +3221,7 @@ msgid "format" msgstr "formato" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "format requiere un dict" #: py/objdeque.c @@ -3684,7 +3684,7 @@ msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "name '%q' no esta definido" #: py/runtime.c @@ -4327,11 +4327,11 @@ msgid "tx and rx cannot both be None" msgstr "ambos tx y rx no pueden ser None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "type '%q' no es un tipo de base aceptable" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "type no es un tipo de base aceptable" #: py/runtime.c @@ -4892,13 +4892,13 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "'%s' object does not support item deletion" #~ msgstr "objeto '%s' no soporta la eliminación de elementos" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "objeto '%s' no es un iterator" #~ msgid "'%s' object is not callable" #~ msgstr "objeto '%s' no puede ser llamado" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "objeto '%s' no es iterable" #~ msgid "'%s' object is not subscriptable" @@ -4916,7 +4916,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "'continue' outside loop" #~ msgstr "'continue' fuera de un bucle" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "el objeto 'coroutine' no es un iterador" #~ msgid "64 bit types" @@ -6376,7 +6376,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la frecuencia solo puede ser 80MHz ó 160MHz" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "la función no tiene argumentos por palabra clave" #~ msgid "function is implemented for scalars and ndarrays only" @@ -6500,7 +6500,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "name must be a string" #~ msgstr "name debe de ser un string" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "name reusado para argumento" #~ msgid "no available NIC" diff --git a/locale/fil.po b/locale/fil.po index 3069ed78c1..bd211d1503 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -313,7 +313,7 @@ msgid "'%q' object does not support '%q'" msgstr "" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -321,7 +321,7 @@ msgid "'%q' object is not callable" msgstr "" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3173,7 +3173,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "kailangan ng format ng dict" #: py/objdeque.c @@ -3635,7 +3635,7 @@ msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "name '%q' ay hindi defined" #: py/runtime.c @@ -4276,11 +4276,11 @@ msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "hindi maari ang type na '%q' para sa base type" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "hindi puede ang type para sa base type" #: py/runtime.c @@ -4596,13 +4596,13 @@ msgstr "" #~ msgid "'%s' object does not support item deletion" #~ msgstr "'%s' object ay hindi sumusuporta sa pagtanggal ng item" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "'%s' object ay hindi iterator" #~ msgid "'%s' object is not callable" #~ msgstr "'%s' object hindi matatawag" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' object ay hindi ma i-iterable" #~ msgid "'%s' object is not subscriptable" @@ -5273,7 +5273,7 @@ msgstr "" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "ang frequency ay dapat 80Mhz or 160MHz lamang" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "ang function ay hindi kumukuha ng mga argumento ng keyword" #~ msgid "impossible baudrate" @@ -5343,7 +5343,7 @@ msgstr "" #~ msgid "name must be a string" #~ msgstr "ang keywords dapat strings" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "name muling ginamit para sa argument" #~ msgid "no available NIC" diff --git a/locale/fr.po b/locale/fr.po index e7516a609d..8b73068d90 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -325,7 +325,7 @@ msgid "'%q' object does not support '%q'" msgstr "l'objet '%q' ne supporte pas '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "l'objet '%q' n'est pas un itérateur" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -333,7 +333,7 @@ msgid "'%q' object is not callable" msgstr "l'objet '%q' ne peut pas être appelé" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "l'objet '%q' n'est pas itérable" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3238,7 +3238,7 @@ msgid "format" msgstr "format" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "le format requier un dict" #: py/objdeque.c @@ -3703,7 +3703,7 @@ msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "nom '%q' non défini" #: py/runtime.c @@ -4347,11 +4347,11 @@ msgid "tx and rx cannot both be None" msgstr "tx et rx ne peuvent être 'None' tous les deux" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "le type '%q' n'est pas un type de base accepté" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "le type n'est pas un type de base accepté" #: py/runtime.c @@ -4920,13 +4920,13 @@ msgstr "zi doit être de forme (n_section, 2)" #~ msgid "'%s' object does not support item deletion" #~ msgstr "l'objet '%s' ne supporte pas la suppression d'éléments" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "l'objet '%s' n'est pas un itérateur" #~ msgid "'%s' object is not callable" #~ msgstr "l'objet '%s' n'est pas appelable" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "l'objet '%s' n'est pas itérable" #~ msgid "'%s' object is not subscriptable" @@ -4944,7 +4944,7 @@ msgstr "zi doit être de forme (n_section, 2)" #~ msgid "'continue' outside loop" #~ msgstr "'continue' dehors d'une boucle" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "L'objet \"coroutine\" n'est pas un itérateur" #~ msgid "(x,y) integers required" @@ -6433,7 +6433,7 @@ msgstr "zi doit être de forme (n_section, 2)" #~ msgid "frequency is read-only for this board" #~ msgstr "la fréquence est en lecture seule pour cette carte" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "la fonction ne prend pas d'arguments nommés" #~ msgid "function is implemented for scalars and ndarrays only" @@ -6562,7 +6562,7 @@ msgstr "zi doit être de forme (n_section, 2)" #~ msgid "name must be a string" #~ msgstr "les noms doivent être des chaînes de caractère" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "nom réutilisé comme paramètre" #~ msgid "no available NIC" diff --git a/locale/hi.po b/locale/hi.po index abffcfe88c..c224dd60ca 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -311,7 +311,7 @@ msgid "'%q' object does not support '%q'" msgstr "" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -319,7 +319,7 @@ msgid "'%q' object is not callable" msgstr "" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3146,7 +3146,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3605,7 +3605,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4246,11 +4246,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 7ef52213ce..accc00692e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -313,7 +313,7 @@ msgid "'%q' object does not support '%q'" msgstr "L'oggetto '%q' non supporta '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "L'oggetto '%q' non è un iteratore" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -321,7 +321,7 @@ msgid "'%q' object is not callable" msgstr "L'oggetto '%q' non è richiamabile" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "L'oggetto '%q' non è iterabile" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3170,7 +3170,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "la formattazione richiede un dict" #: py/objdeque.c @@ -3633,7 +3633,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "nome '%q'non definito" #: py/runtime.c @@ -4278,11 +4278,11 @@ msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "il tipo '%q' non è un tipo di base accettabile" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "il tipo non è un tipo di base accettabile" #: py/runtime.c @@ -4642,13 +4642,13 @@ msgstr "" #~ msgid "'%s' object does not support item deletion" #~ msgstr "oggeto '%s' non supporta eliminamento di item" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "l'oggetto '%s' non è un iteratore" #~ msgid "'%s' object is not callable" #~ msgstr "oggeto '%s' non è chiamabile" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "l'oggetto '%s' non è iterabile" #~ msgid "'%s' object is not subscriptable" @@ -4664,7 +4664,7 @@ msgstr "" #~ msgid "'continue' outside loop" #~ msgstr "'continue' fuori del ciclo" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "L'oggetto 'coroutine' non è un iteratore" #~ msgid "64 bit types" @@ -5327,7 +5327,7 @@ msgstr "" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la frequenza può essere o 80Mhz o 160Mhz" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "la funzione non prende argomenti nominati" #~ msgid "impossible baudrate" @@ -5394,7 +5394,7 @@ msgstr "" #~ msgid "name must be a string" #~ msgstr "argomenti nominati devono essere stringhe" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "nome riutilizzato come argomento" #, fuzzy diff --git a/locale/ja.po b/locale/ja.po index ef29c947b1..101d4662f0 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -324,7 +324,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' オブジェクトは '%q' に対応していません" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "オブジェクト'%q'はイテレータではありません" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -332,7 +332,7 @@ msgid "'%q' object is not callable" msgstr "オブジェクト'%q'は呼び出し可能ではありません" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "オブジェクト'%q'はイテレート可能ではありません" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3173,7 +3173,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "formatにはdictが必要" #: py/objdeque.c @@ -3633,7 +3633,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "名前 '%q' は定義されていません" #: py/runtime.c @@ -4274,11 +4274,11 @@ msgid "tx and rx cannot both be None" msgstr "txとrxを両方ともNoneにできません" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "型'%q'はベース型として使えません" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "この型はベース型にできません" #: py/runtime.c @@ -4649,7 +4649,7 @@ msgstr "" #~ msgid "'continue' outside loop" #~ msgstr "ループ外でのcontinue" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "'coroutine' オブジェクトはイテレータではありません" #~ msgid "Address type out of range" @@ -5249,7 +5249,7 @@ msgstr "" #~ msgid "n must be between 0, and 9" #~ msgstr "nは0から9まで" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "引数で名前が再利用されています" #~ msgid "no available NIC" diff --git a/locale/ko.po b/locale/ko.po index a06ff26372..2e6921c094 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -334,7 +334,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' 개체가 '%q'를 지원하지 않습니다" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "'%q' 개체가 iterator가 아닙니다" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -342,7 +342,7 @@ msgid "'%q' object is not callable" msgstr "'%q' 개체를 호출할 수 없습니다" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "'%q' 개체를 사용할 수 없습니다" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3222,7 +3222,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3681,7 +3681,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4322,11 +4322,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c @@ -4658,13 +4658,13 @@ msgstr "" #~ msgid "'%s' object does not support item deletion" #~ msgstr "'%s' 은 삭제할 수 없습니다" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "'%s' 은 수정할 수 없습니다" #~ msgid "'%s' object is not callable" #~ msgstr "'%s' 을 검색 할 수 없습니다" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' 은 변경할 수 없습니다" #~ msgid "'break' outside loop" diff --git a/locale/nl.po b/locale/nl.po index ade9593a2c..4072a8983e 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -309,7 +309,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' object ondersteunt geen '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "'%q' object is geen iterator" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -317,7 +317,7 @@ msgid "'%q' object is not callable" msgstr "'%q' object is niet aanroepbaar" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "'%q' object is niet itereerbaar" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3165,7 +3165,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "format vereist een dict" #: py/objdeque.c @@ -3627,7 +3627,7 @@ msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "naam '%q' is niet gedefinieerd" #: py/runtime.c @@ -4268,11 +4268,11 @@ msgid "tx and rx cannot both be None" msgstr "tx en rx kunnen niet beiden None zijn" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "type '%q' is geen aanvaardbaar basistype" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "type is geen aanvaardbaar basistype" #: py/runtime.c @@ -4704,13 +4704,13 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "'%s' object does not support item deletion" #~ msgstr "'%s' object ondersteunt item verwijdering niet" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "'%s' object is geen iterator" #~ msgid "'%s' object is not callable" #~ msgstr "'%s' object is niet aanroepbaar" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' object is niet itereerbaar" #~ msgid "'%s' object is not subscriptable" @@ -4728,7 +4728,7 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "'continue' outside loop" #~ msgstr "'continue' buiten de loop" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "'coroutine' object is geen iterator" #~ msgid "ADC2 is being used by WiFi" @@ -5505,7 +5505,7 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "firstbit must be MSB" #~ msgstr "het eerste bit moet het MSB zijn" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "functie accepteert geen keyword argumenten" #~ msgid "function is implemented for scalars and ndarrays only" @@ -5583,7 +5583,7 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "n must be between 0, and 9" #~ msgstr "n moet tussen 0 en 9 liggen" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "naam hergebruikt voor argument" #~ msgid "no available NIC" diff --git a/locale/pl.po b/locale/pl.po index 0c565f72d8..fcbafb74a7 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -317,7 +317,7 @@ msgid "'%q' object does not support '%q'" msgstr "Obiekt '%q' nie wspiera '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "Obiekt '%q' nie jest iteratorem" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -325,7 +325,7 @@ msgid "'%q' object is not callable" msgstr "Obiekt '%q' nie jest wywoływalny" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "Obiekt '%q' nie jest iterowalny" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3175,7 +3175,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "format wymaga słownika" #: py/objdeque.c @@ -3635,7 +3635,7 @@ msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "nazwa '%q' niezdefiniowana" #: py/runtime.c @@ -4276,11 +4276,11 @@ msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogą być oba None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "typ '%q' nie może być bazowy" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "typ nie może być bazowy" #: py/runtime.c @@ -4684,13 +4684,13 @@ msgstr "" #~ msgid "'%s' object does not support item deletion" #~ msgstr "'%s' obiekt nie wspiera usuwania elementów" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "'%s' obiekt nie jest iteratorem" #~ msgid "'%s' object is not callable" #~ msgstr "'%s' nie można wywoływać obiektu" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' nie można iterować po obiekcie" #~ msgid "'%s' object is not subscriptable" @@ -5454,7 +5454,7 @@ msgstr "" #~ msgid "firstbit must be MSB" #~ msgstr "firstbit musi być MSB" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "funkcja nie bierze argumentów nazwanych" #~ msgid "int() arg 2 must be >= 2 and <= 36" @@ -5502,7 +5502,7 @@ msgstr "" #~ msgid "name must be a string" #~ msgstr "nazwa musi być łańcuchem" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "nazwa użyta ponownie jako argument" #~ msgid "no available NIC" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a1b6b9ff5c..8956dd1304 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -322,7 +322,7 @@ msgid "'%q' object does not support '%q'" msgstr "O objeto '%q' não suporta '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "O objeto '%q' não é um iterador" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -330,7 +330,7 @@ msgid "'%q' object is not callable" msgstr "O objeto '%s' não é invocável" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "O objeto '%q' não é iterável" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3229,7 +3229,7 @@ msgid "format" msgstr "formato" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "formato requer um dict" #: py/objdeque.c @@ -3694,7 +3694,7 @@ msgid "must use keyword argument for key function" msgstr "deve usar o argumento da palavra-chave para a função da chave" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "o nome '%q' não está definido" #: py/runtime.c @@ -4341,11 +4341,11 @@ msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "o tipo '%q' não é um tipo base aceitável" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "tipo não é um tipo base aceitável" #: py/runtime.c @@ -4940,13 +4940,13 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "'%s' object does not support item deletion" #~ msgstr "O objeto '%s' não é compatível com exclusão do item" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "O objeto '%s' não é um iterador" #~ msgid "'%s' object is not callable" #~ msgstr "O objeto '%s' não é invocável" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "O objeto '%s' não é iterável" #~ msgid "'%s' object is not subscriptable" @@ -4966,7 +4966,7 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "'continue' outside loop" #~ msgstr "'continue' fora do loop" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "O objeto 'corrotina' não é um iterador" #~ msgid "(x,y) integers required" @@ -6323,7 +6323,7 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "frequency is read-only for this board" #~ msgstr "nesta placa, a frequência é de apenas leitura" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "função não aceita argumentos de palavras-chave" #~ msgid "function is implemented for scalars and ndarrays only" @@ -6452,7 +6452,7 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "name must be a string" #~ msgstr "heap deve ser uma lista" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "o nome foi reutilizado para o argumento" #~ msgid "no available NIC" diff --git a/locale/ru.po b/locale/ru.po index d2e11451a0..b97f8f5d22 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -324,7 +324,7 @@ msgid "'%q' object does not support '%q'" msgstr "Объект '%q' не поддерживает '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "Объект '%q' не является итератором" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -332,7 +332,7 @@ msgid "'%q' object is not callable" msgstr "Объект '%q' не является вызываемым" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "Объект '%q' не является итерируемым" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3227,7 +3227,7 @@ msgid "format" msgstr "формат" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "Формат требует диктата" #: py/objdeque.c @@ -3692,7 +3692,7 @@ msgid "must use keyword argument for key function" msgstr "Необходимо использовать аргумент ключевого слова для ключевой функции" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "Имя '%q' не определено" #: py/runtime.c @@ -4337,11 +4337,11 @@ msgid "tx and rx cannot both be None" msgstr "tx и rx не могут быть одновременно None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "Тип '%Q' не является допустимым базовым типом" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "Тип не является приемлемым базовым типом" #: py/runtime.c @@ -4824,7 +4824,7 @@ msgstr "zi должен иметь форму (n_section, 2)" #~ msgid "'continue' outside loop" #~ msgstr "«продолжить» вне цикла" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "Объект 'coroutine' не является итератором" #~ msgid "(x,y) integers required" diff --git a/locale/sv.po b/locale/sv.po index c8b9468f5c..ce2e3fc188 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -323,7 +323,7 @@ msgid "'%q' object does not support '%q'" msgstr "Objektet '%q' stöder inte '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "Objektet '%q' är inte en iterator" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -331,7 +331,7 @@ msgid "'%q' object is not callable" msgstr "Objektet '%q' kan inte anropas" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "Objektet '%q' är inte itererbart" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3194,7 +3194,7 @@ msgid "format" msgstr "format" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "formatet kräver en dict" #: py/objdeque.c @@ -3655,7 +3655,7 @@ msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "namnet '%q' är inte definierat" #: py/runtime.c @@ -4296,11 +4296,11 @@ msgid "tx and rx cannot both be None" msgstr "tx och rx kan inte båda vara None" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "typ '%q' är inte en acceptabel bastyp" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "typ är inte en acceptabel bastyp" #: py/runtime.c @@ -4886,13 +4886,13 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "'%s' object does not support item deletion" #~ msgstr "Objektet '%s' stöder inte borttagning av objekt" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "Objektet '%s' är inte en iterator" #~ msgid "'%s' object is not callable" #~ msgstr "Objektet '%s' kan inte anropas" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "Objektet '%s' är inte itererable" #~ msgid "'%s' object is not subscriptable" @@ -4910,7 +4910,7 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "'continue' outside loop" #~ msgstr "'continue' utanför loop" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "objektet 'coroutine\" är inte en iterator" #~ msgid "(x,y) integers required" @@ -6013,7 +6013,7 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "frequency is read-only for this board" #~ msgstr "frekvens är skrivskyddad för detta kort" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "funktionen tar inte nyckelordsargument" #~ msgid "function is implemented for scalars and ndarrays only" @@ -6113,7 +6113,7 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "n must be between 0, and 9" #~ msgstr "n måste vara mellan 0 och 9" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "namn återanvänt för argument" #~ msgid "no available NIC" diff --git a/locale/tr.po b/locale/tr.po index 30c8f3d107..e5cdfed792 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -322,7 +322,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' nesnesi '%q' öğesini desteklemiyor" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "'%q' nesnesi bir iteratör değildir" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -330,7 +330,7 @@ msgid "'%q' object is not callable" msgstr "'%q' nesnesi çağrılabilir değil" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "'%q' nesnesi iterable değildir" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3168,7 +3168,7 @@ msgid "format" msgstr "" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "" #: py/objdeque.c @@ -3627,7 +3627,7 @@ msgid "must use keyword argument for key function" msgstr "" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "" #: py/runtime.c @@ -4268,11 +4268,11 @@ msgid "tx and rx cannot both be None" msgstr "" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "" #: py/runtime.c @@ -4610,7 +4610,7 @@ msgstr "" #~ msgid "'continue' outside loop" #~ msgstr "döngü dışında 'continue'" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "'coroutine' nesnesi bir iteratör değildir" #~ msgid "(x,y) integers required" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 85eb703d4d..3897ab8825 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -324,7 +324,7 @@ msgid "'%q' object does not support '%q'" msgstr "'%q' duì xiàng bù zhī chí '%q'" #: py/runtime.c -msgid "'%q' object is not an iterator" +msgid "'%q' object isn't an iterator" msgstr "%q' duìxiàng bùshì yígè diédàiqì" #: py/objtype.c py/runtime.c shared-module/atexit/__init__.c @@ -332,7 +332,7 @@ msgid "'%q' object is not callable" msgstr "%q' duìxiàng bù kě bèi diàoyòng" #: py/runtime.c -msgid "'%q' object is not iterable" +msgid "'%q' object isn't iterable" msgstr "%q' duìxiàng bù kě yòngyú diédài" #: py/emitinlinethumb.c py/emitinlinextensa.c @@ -3201,7 +3201,7 @@ msgid "format" msgstr "Géshì" #: py/objstr.c -msgid "format requires a dict" +msgid "format needs a dict" msgstr "géshì yāoqiú yīgè yǔjù" #: py/objdeque.c @@ -3661,7 +3661,7 @@ msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" #: py/runtime.c -msgid "name '%q' is not defined" +msgid "name '%q' isn't defined" msgstr "míngchēng '%q' wèi dìngyì" #: py/runtime.c @@ -4305,11 +4305,11 @@ msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dōu shì wú" #: py/objtype.c -msgid "type '%q' is not an acceptable base type" +msgid "type '%q' isn't an acceptable base type" msgstr "lèixíng '%q' bùshì kě jiēshòu de jīchǔ lèixíng" #: py/objtype.c -msgid "type is not an acceptable base type" +msgid "type isn't an acceptable base type" msgstr "lèixíng bùshì kě jiēshòu de jīchǔ lèixíng" #: py/runtime.c @@ -4889,13 +4889,13 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "'%s' object does not support item deletion" #~ msgstr "'%s' duìxiàng bù zhīchí shānchú xiàngmù" -#~ msgid "'%s' object is not an iterator" +#~ msgid "'%s' object isn't an iterator" #~ msgstr "'%s' duìxiàng bùshì yīgè diédài qì" #~ msgid "'%s' object is not callable" #~ msgstr "'%s' duìxiàng wúfǎ diàoyòng" -#~ msgid "'%s' object is not iterable" +#~ msgid "'%s' object isn't iterable" #~ msgstr "'%s' duìxiàng bùnéng diédài" #~ msgid "'%s' object is not subscriptable" @@ -4911,7 +4911,7 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "'continue' outside loop" #~ msgstr "'continue' wèiyú xúnhuán zhīwài" -#~ msgid "'coroutine' object is not an iterator" +#~ msgid "'coroutine' object isn't an iterator" #~ msgstr "'coroutine' duìxiàng búshì yígè diédàiqì" #~ msgid "(x,y) integers required" @@ -6259,7 +6259,7 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "frequency is read-only for this board" #~ msgstr "cǐ zhǔ bǎn de pín lǜ wéi zhǐ dú" -#~ msgid "function does not take keyword arguments" +#~ msgid "function doesn't take keyword arguments" #~ msgstr "hánshù méiyǒu guānjiàn cí cānshù" #~ msgid "function is implemented for scalars and ndarrays only" @@ -6361,7 +6361,7 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "name must be a string" #~ msgstr "míngchēng bìxū shì yīgè zìfú chuàn" -#~ msgid "name reused for argument" +#~ msgid "argument name reused" #~ msgstr "cān shǔ míngchēng bèi chóngxīn shǐyòng" #~ msgid "no available NIC" diff --git a/ports/unix/coveragecpp.cpp b/ports/unix/coveragecpp.cpp index 23c3955ae9..377b5acf76 100644 --- a/ports/unix/coveragecpp.cpp +++ b/ports/unix/coveragecpp.cpp @@ -1,20 +1,6 @@ extern "C" { -// Include the complete public API to verify everything compiles as C++. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// CIRCUITPY-CHANGE: do not include everything: it causes compilation warnings +#include "py/obj.h" } #if defined(MICROPY_UNIX_COVERAGE) diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index d0b93ec3d0..4d9fe9f1dc 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -127,8 +127,9 @@ typedef long mp_off_t; #define MICROPY_HELPER_LEXER_UNIX (1) #define MICROPY_VFS_POSIX (1) #define MICROPY_READER_POSIX (1) -#if MICROPY_PY_FFI || MICROPY_BLUETOOTH_BTSTACK -#define MICROPY_TRACKED_ALLOC (1) +// CIRCUITPY-CHANGE: define no matter what +#ifndef MICROPY_TRACKED_ALLOC +#define MICROPY_TRACKED_ALLOC (MICROPY_PY_FFI || MICROPY_BLUETOOTH_BTSTACK) #endif // VFS stat functions should return time values relative to 1970/1/1 diff --git a/ports/unix/variants/coverage/mpconfigvariant.h b/ports/unix/variants/coverage/mpconfigvariant.h index 11f4b2eb4b..12823f3c2b 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.h +++ b/ports/unix/variants/coverage/mpconfigvariant.h @@ -45,5 +45,6 @@ // CIRCUITPY-CHANGE: Disable things never used in circuitpython #define MICROPY_PY_CRYPTOLIB (0) #define MICROPY_PY_CRYPTOLIB_CTR (0) +#define MICROPY_PY_MICROPYTHON_RINGIO (0) // CircuitPython uses shared-bindings struct #define MICROPY_PY_STRUCT (0) diff --git a/py/mpconfig.h b/py/mpconfig.h index 0dff68ba51..20e237cc1c 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -423,6 +423,11 @@ #define MICROPY_EMIT_RV32 (0) #endif +// CIRCUITPY-CHANGE: make sure MICROPY_EMIT_NATIVE_DEBUG is defined +#ifndef MICROPY_EMIT_NATIVE_DEBUG +#define MICROPY_EMIT_NATIVE_DEBUG (0) +#endif + // Convenience definition for whether any native emitter is enabled #define MICROPY_EMIT_NATIVE (MICROPY_EMIT_X64 || MICROPY_EMIT_X86 || MICROPY_EMIT_THUMB || MICROPY_EMIT_ARM || MICROPY_EMIT_XTENSA || MICROPY_EMIT_XTENSAWIN || MICROPY_EMIT_RV32 || MICROPY_EMIT_NATIVE_DEBUG) @@ -1865,6 +1870,11 @@ typedef double mp_float_t; #define MICROPY_PY_SSL (0) #endif +// CIRCUITPY-CHANGE: avoid undefined warnings +#ifndef MICROPY_PY_SSL_ECDSA_SIGN_ALT +#define MICROPY_PY_SSL_ECDSA_SIGN_ALT (0) +#endif + // Whether to add finaliser code to ssl objects #ifndef MICROPY_PY_SSL_FINALISER #define MICROPY_PY_SSL_FINALISER (MICROPY_ENABLE_FINALISER) diff --git a/py/mpstate.h b/py/mpstate.h index 11090da40d..aa85bd450c 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -324,6 +324,8 @@ typedef struct _mp_state_thread_t { #if MICROPY_PY_SSL_MBEDTLS_NEED_ACTIVE_CONTEXT struct _mp_obj_ssl_context_t *tls_ssl_context; + #endif + // CIRCUITPY-CHANGE #if CIRCUITPY_WARNINGS warnings_action_t warnings_action; @@ -354,4 +356,4 @@ extern mp_state_thread_t *mp_thread_get_state(void); #define mp_thread_is_main_thread() (true) #endif - #endif // MICROPY_INCLUDED_PY_MPSTATE_H +#endif // MICROPY_INCLUDED_PY_MPSTATE_H diff --git a/py/nlr.c b/py/nlr.c index 516b8b8627..7ab0c0955a 100644 --- a/py/nlr.c +++ b/py/nlr.c @@ -28,8 +28,7 @@ #if !MICROPY_NLR_SETJMP // When not using setjmp, nlr_push_tail is called from inline asm so needs special care -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_X86) && MICROPY_NLR_X86 && defined(MICROPY_NLR_OS_WINDOWS) && MICROPY_NLR_OS_WINDOWS +#if MICROPY_NLR_X86 && MICROPY_NLR_OS_WINDOWS // On these 32-bit platforms make sure nlr_push_tail doesn't have a leading underscore unsigned int nlr_push_tail(nlr_buf_t *nlr) asm ("nlr_push_tail"); #else diff --git a/py/nlr.h b/py/nlr.h index afe1097b51..340627b7aa 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -117,10 +117,49 @@ #endif #endif -// CIRCUITPY-CHANGE -// If MICROPY_NLR_SETJMP is not defined above - define/disable it here -#if !defined(MICROPY_NLR_SETJMP) - #define MICROPY_NLR_SETJMP (0) +// CIRCUITPY-CHANGE: Avoid warnings by defining all these MICROPY_PY_NLR_* macros +#ifndef MICROPY_NLR_AARCH64 +#define MICROPY_NLR_AARCH64 (0) +#endif + +#ifndef MICROPY_NLR_MIPS +#define MICROPY_NLR_MIPS (0) +#endif + +#ifndef MICROPY_NLR_OS_WINDOWS +#define MICROPY_NLR_OS_WINDOWS (0) +#endif + +#ifndef MICROPY_NLR_POWERPC +#define MICROPY_NLR_POWERPC (0) +#endif + +#ifndef MICROPY_NLR_RV32I +#define MICROPY_NLR_RV32I (0) +#endif + +#ifndef MICROPY_NLR_RV64I +#define MICROPY_NLR_RV64I (0) +#endif + +#ifndef MICROPY_NLR_SETJMP +#define MICROPY_NLR_SETJMP (0) +#endif + +#ifndef MICROPY_NLR_THUMB +#define MICROPY_NLR_THUMB (0) +#endif + +#ifndef MICROPY_NLR_X64 +#define MICROPY_NLR_X64 (0) +#endif + +#ifndef MICROPY_NLR_X86 +#define MICROPY_NLR_X86 (0) +#endif + +#ifndef MICROPY_NLR_XTENSA +#define MICROPY_NLR_XTENSA (0) #endif // *FORMAT-ON* diff --git a/py/nlraarch64.c b/py/nlraarch64.c index 898d9e2a76..d6d87ebc50 100644 --- a/py/nlraarch64.c +++ b/py/nlraarch64.c @@ -26,8 +26,7 @@ #include "py/mpstate.h" // needed for NLR defs -// CIRCUITPY-CHANGE: avoid warnings -#if defined(MICROPY_NLR_AARCH64) && MICROPY_NLR_AARCH64 +#if MICROPY_NLR_AARCH64 // AArch64 callee-saved registers are x19-x29. // https://en.wikipedia.org/wiki/Calling_convention#ARM_(A64) diff --git a/py/nlrmips.c b/py/nlrmips.c index a60c3abd71..cba52b16a2 100644 --- a/py/nlrmips.c +++ b/py/nlrmips.c @@ -26,8 +26,7 @@ #include "py/mpstate.h" -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_MIPS) && MICROPY_NLR_MIPS +#if MICROPY_NLR_MIPS __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr); diff --git a/py/nlrpowerpc.c b/py/nlrpowerpc.c index ae2f92a078..8a69fe1eec 100644 --- a/py/nlrpowerpc.c +++ b/py/nlrpowerpc.c @@ -26,8 +26,7 @@ #include "py/mpstate.h" -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_POWERPC) && MICROPY_NLR_POWERPC +#if MICROPY_NLR_POWERPC #undef nlr_push diff --git a/py/nlrthumb.c b/py/nlrthumb.c index de4d69eabd..0aa1f053a2 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -26,8 +26,7 @@ #include "py/mpstate.h" -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_THUMB) && MICROPY_NLR_THUMB +#if MICROPY_NLR_THUMB #undef nlr_push diff --git a/py/nlrx64.c b/py/nlrx64.c index 63586a2199..d1ad91ff7d 100644 --- a/py/nlrx64.c +++ b/py/nlrx64.c @@ -26,8 +26,7 @@ #include "py/mpstate.h" -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_X64) && MICROPY_NLR_X64 +#if MICROPY_NLR_X64 #undef nlr_push diff --git a/py/nlrx86.c b/py/nlrx86.c index a2ce8424f9..085e30d203 100644 --- a/py/nlrx86.c +++ b/py/nlrx86.c @@ -26,16 +26,14 @@ #include "py/mpstate.h" -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_X86) && MICROPY_NLR_X86 +#if MICROPY_NLR_X86 #undef nlr_push // For reference, x86 callee save regs are: // ebx, esi, edi, ebp, esp, eip -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_OS_WINDOWS) && MICROPY_NLR_OS_WINDOWS +#if MICROPY_NLR_OS_WINDOWS unsigned int nlr_push_tail(nlr_buf_t *nlr) asm ("nlr_push_tail"); #else __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr); diff --git a/py/nlrxtensa.c b/py/nlrxtensa.c index 62e799dbdc..ff7af6edee 100644 --- a/py/nlrxtensa.c +++ b/py/nlrxtensa.c @@ -26,8 +26,7 @@ #include "py/mpstate.h" -// CIRCUITPY-CHANGE: avoid warning -#if defined(MICROPY_NLR_XTENSA) && MICROPY_NLR_XTENSA +#if MICROPY_NLR_XTENSA #undef nlr_push diff --git a/py/objstr.c b/py/objstr.c index 9a7900c4e9..d1e0d58b6e 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1503,8 +1503,7 @@ static mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ // Dictionary value lookup if (*str == '(') { if (dict == MP_OBJ_NULL) { - // CIRCUITPY-CHANGE: clearer message - mp_raise_TypeError(MP_ERROR_TEXT("format requires a dict")); + mp_raise_TypeError(MP_ERROR_TEXT("format needs a dict")); } arg_i = 1; // we used up the single dict argument const byte *key = ++str; @@ -1585,8 +1584,7 @@ static mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ if (arg == MP_OBJ_NULL) { if (arg_i >= n_args) { not_enough_args: - // CIRCUITPY-CHANGE: clearer message - mp_raise_TypeError(MP_ERROR_TEXT("not enough arguments for format string")); + mp_raise_TypeError(MP_ERROR_TEXT("format string needs more arguments")); } arg = args[arg_i++]; } @@ -1596,16 +1594,14 @@ static mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ size_t slen; const char *s = mp_obj_str_get_data(arg, &slen); if (slen != 1) { - // CIRCUITPY-CHANGE: clearer message - mp_raise_TypeError(MP_ERROR_TEXT("%%c requires int or char")); + mp_raise_TypeError(MP_ERROR_TEXT("%%c needs int or char")); } mp_print_strn(&print, s, 1, flags, ' ', width); } else if (arg_looks_integer(arg)) { char ch = mp_obj_get_int(arg); mp_print_strn(&print, &ch, 1, flags, ' ', width); } else { - // CIRCUITPY-CHANGE: clearer message - mp_raise_TypeError(MP_ERROR_TEXT("%%c requires int or char")); + mp_raise_TypeError(MP_ERROR_TEXT("%%c needs int or char")); } break; @@ -1677,8 +1673,7 @@ static mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ if (dict == MP_OBJ_NULL && arg_i != n_args) { // NOTE: if `dict` exists, then `n_args` is 1 and the dict is always consumed; either // positionally, or as a map of named args, even if none were actually referenced. - // CIRCUITPY-CHANGE: clearer message - mp_raise_TypeError(MP_ERROR_TEXT("not all arguments converted during string formatting")); + mp_raise_TypeError(MP_ERROR_TEXT("format string didn't convert all arguments")); } return mp_obj_new_str_type_from_vstr(is_bytes ? &mp_type_bytes : &mp_type_str, &vstr); diff --git a/py/objtype.c b/py/objtype.c index d004600645..074d6f3929 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -689,6 +689,13 @@ static void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *des // try __getattr__ if (attr != MP_QSTR___getattr__) { + #if MICROPY_PY_DESCRIPTORS + // With descriptors enabled, don't delegate lookups of __get__/__set__/__delete__. + if (attr == MP_QSTR___get__ || attr == MP_QSTR___set__ || attr == MP_QSTR___delete__) { + return; + } + #endif + #if MICROPY_PY_DELATTR_SETATTR // If the requested attr is __setattr__/__delattr__ then don't delegate the lookup // to __getattr__. If we followed CPython's behaviour then __setattr__/__delattr__ @@ -909,7 +916,7 @@ mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons mp_raise_TypeError(MP_ERROR_TEXT("object not callable")); #else // CIRCUITPY-CHANGE: use more specific raise - mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object is not callable"), + mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object isn't callable"), mp_obj_get_type_qstr(self_in)); #endif } @@ -1036,11 +1043,10 @@ static mp_obj_t type_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp if (!MP_OBJ_TYPE_HAS_SLOT(self, make_new)) { #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE - // CIRCUITPY-CHANGE: error message change mp_raise_TypeError(MP_ERROR_TEXT("cannot create instance")); #else - // CIRCUITPY-CHANGE: error message change - mp_raise_TypeError_varg(MP_ERROR_TEXT("cannot create '%q' instances"), self->name); + // CIRCUITPY-CHANGE: more specific mp_raise + mp_raise_TypeError_varg(MP_ERROR_TEXT("can't create '%q' instances"), self->name); #endif } @@ -1181,12 +1187,11 @@ mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) // TODO: Verify with CPy, tested on function type if (!MP_OBJ_TYPE_HAS_SLOT(t, make_new)) { #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE - // CIRCUITPY-CHANGE: error message change - mp_raise_TypeError(MP_ERROR_TEXT("type is not an acceptable base type")); + mp_raise_TypeError(MP_ERROR_TEXT("type isn't an acceptable base type")); #else - // CIRCUITPY-CHANGE: error message change + // CIRCUITPY-CHANGE: more specific mp_raise mp_raise_TypeError_varg( - MP_ERROR_TEXT("type '%q' is not an acceptable base type"), t->name); + MP_ERROR_TEXT("type '%q' isn't an acceptable base type"), t->name); #endif } #if ENABLE_SPECIAL_ACCESSORS @@ -1306,223 +1311,251 @@ static mp_obj_t super_make_new(const mp_obj_type_t *type_in, size_t n_args, size // 1 argument is not yet implemented mp_arg_check_num(n_args, n_kw, 2, 2, false); + // CIRCUITPY-CHANGE: check type of first arg if (!mp_obj_is_type(args[0], &mp_type_type)) { - // CIRCUITPY-CHANGE: error message mp_raise_TypeError(MP_ERROR_TEXT("first argument to super() must be type")); - - // Per CPython: "If the second argument is an object, isinstance(obj, type) must be true. - // If the second argument is a type, issubclass(type2, type) must be true (this is useful for classmethods)." - const mp_obj_type_t *second_arg_type = mp_obj_get_type(args[1]); - mp_obj_t second_arg_obj = second_arg_type == &mp_type_type ? args[1] : MP_OBJ_FROM_PTR(second_arg_type); - if (mp_obj_is_subclass(second_arg_obj, args[0]) == mp_const_false) { - mp_raise_TypeError(NULL); - } - - mp_obj_super_t *o = m_new_obj(mp_obj_super_t); - *o = (mp_obj_super_t) {{type_in}, args[0], args[1]}; - return MP_OBJ_FROM_PTR(o); } - static void super_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { - if (dest[0] != MP_OBJ_NULL) { - // not load attribute - return; + // Per CPython: "If the second argument is an object, isinstance(obj, type) must be true. + // If the second argument is a type, issubclass(type2, type) must be true (this is useful for classmethods)." + const mp_obj_type_t *second_arg_type = mp_obj_get_type(args[1]); + mp_obj_t second_arg_obj = second_arg_type == &mp_type_type ? args[1] : MP_OBJ_FROM_PTR(second_arg_type); + if (mp_obj_is_subclass(second_arg_obj, args[0]) == mp_const_false) { + mp_raise_TypeError(NULL); + } + + mp_obj_super_t *o = m_new_obj(mp_obj_super_t); + *o = (mp_obj_super_t) {{type_in}, args[0], args[1]}; + return MP_OBJ_FROM_PTR(o); +} + +static void super_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { + if (dest[0] != MP_OBJ_NULL) { + // not load attribute + return; + } + + assert(mp_obj_is_type(self_in, &mp_type_super)); + mp_obj_super_t *self = MP_OBJ_TO_PTR(self_in); + + assert(mp_obj_is_type(self->type, &mp_type_type)); + + mp_obj_type_t *type = MP_OBJ_TO_PTR(self->type); + + struct class_lookup_data lookup = { + .obj = MP_OBJ_TO_PTR(self->obj), + .attr = attr, + .slot_offset = 0, + .dest = dest, + .is_type = false, + }; + + // Allow a call super().__init__() to reach any native base classes. + if (attr == MP_QSTR___init__) { + lookup.slot_offset = MP_OBJ_TYPE_OFFSETOF_SLOT(make_new); + } + + if (!MP_OBJ_TYPE_HAS_SLOT(type, parent)) { + // no parents, do nothing + #if MICROPY_MULTIPLE_INHERITANCE + } else if (((mp_obj_base_t *)MP_OBJ_TYPE_GET_SLOT(type, parent))->type == &mp_type_tuple) { + const mp_obj_tuple_t *parent_tuple = MP_OBJ_TYPE_GET_SLOT(type, parent); + size_t len = parent_tuple->len; + const mp_obj_t *items = parent_tuple->items; + for (size_t i = 0; i < len; i++) { + assert(mp_obj_is_type(items[i], &mp_type_type)); + if (MP_OBJ_TO_PTR(items[i]) == &mp_type_object) { + // The "object" type will be searched at the end of this function, + // and we don't want to lookup native methods in object. + continue; + } + + mp_obj_class_lookup(&lookup, (mp_obj_type_t *)MP_OBJ_TO_PTR(items[i])); + if (dest[0] != MP_OBJ_NULL) { + break; + } } + #endif + } else if (MP_OBJ_TYPE_GET_SLOT(type, parent) != &mp_type_object) { + mp_obj_class_lookup(&lookup, MP_OBJ_TYPE_GET_SLOT(type, parent)); + } - assert(mp_obj_is_type(self_in, &mp_type_super)); - mp_obj_super_t *self = MP_OBJ_TO_PTR(self_in); - - assert(mp_obj_is_type(self->type, &mp_type_type)); - - mp_obj_type_t *type = MP_OBJ_TO_PTR(self->type); - - struct class_lookup_data lookup = { - .obj = MP_OBJ_TO_PTR(self->obj), - .attr = attr, - .slot_offset = 0, - .dest = dest, - .is_type = false, - }; - - // Allow a call super().__init__() to reach any native base classes. - if (attr == MP_QSTR___init__) { - lookup.slot_offset = MP_OBJ_TYPE_OFFSETOF_SLOT(make_new); - } - - if (!MP_OBJ_TYPE_HAS_SLOT(type, parent)) { - // no parents, do nothing - #if MICROPY_MULTIPLE_INHERITANCE - } else if (((mp_obj_base_t *)MP_OBJ_TYPE_GET_SLOT(type, parent))->type == &mp_type_tuple) { - const mp_obj_tuple_t *parent_tuple = MP_OBJ_TYPE_GET_SLOT(type, parent); - size_t len = parent_tuple->len; - const mp_obj_t *items = parent_tuple->items; - for (size_t i = 0; i < len; i++) { - assert(mp_obj_is_type(items[i], &mp_type_type)); - if (MP_OBJ_TO_PTR(items[i]) == &mp_type_object) { - // The "object" type will be searched at the end of this function, - // and we don't want to lookup native methods in object. - continue; - } - - mp_obj_class_lookup(&lookup, (mp_obj_type_t *)MP_OBJ_TO_PTR(items[i])); - if (dest[0] != MP_OBJ_NULL) { - break; + if (dest[0] != MP_OBJ_NULL) { + if (dest[0] == MP_OBJ_SENTINEL) { + // Looked up native __init__ so defer to it + dest[0] = MP_OBJ_FROM_PTR(&native_base_init_wrapper_obj); + dest[1] = self->obj; + // CIRCUITPY-CHANGE: better support for properties + } else { + mp_obj_t member = dest[0]; + // changes to mp_obj_instance_load_attr may require changes + // here... + #if MICROPY_PY_BUILTINS_PROPERTY + if (mp_obj_is_type(member, &mp_type_property)) { + size_t n_proxy; + const mp_obj_t *proxy = mp_obj_property_get(member, &n_proxy); + if (proxy[0] == mp_const_none) { + mp_raise_AttributeError(MP_ERROR_TEXT("unreadable attribute")); + } else { + dest[0] = mp_call_function_n_kw(proxy[0], 1, 0, &self_in); } } - #endif - } else if (MP_OBJ_TYPE_GET_SLOT(type, parent) != &mp_type_object) { - mp_obj_class_lookup(&lookup, MP_OBJ_TYPE_GET_SLOT(type, parent)); - } - - if (dest[0] != MP_OBJ_NULL) { - if (dest[0] == MP_OBJ_SENTINEL) { - // Looked up native __init__ so defer to it - dest[0] = MP_OBJ_FROM_PTR(&native_base_init_wrapper_obj); - dest[1] = self->obj; + #endif + #if MICROPY_PY_DESCRIPTORS + mp_obj_t attr_get_method[4]; + mp_load_method_maybe(member, MP_QSTR___get__, attr_get_method); + if (attr_get_method[0] != MP_OBJ_NULL) { + attr_get_method[2] = self_in; + attr_get_method[3] = MP_OBJ_FROM_PTR(mp_obj_get_type(self_in)); + dest[0] = mp_call_method_n_kw(2, 0, attr_get_method); } - return; + #endif } - - // Reset slot_offset so we don't look up any native methods in object, - // because object never takes up the native base-class slot. - lookup.slot_offset = 0; - - mp_obj_class_lookup(&lookup, &mp_type_object); + return; } - MP_DEFINE_CONST_OBJ_TYPE( - mp_type_super, - MP_QSTR_super, - MP_TYPE_FLAG_NONE, - make_new, super_make_new, - print, super_print, - attr, super_attr - ); + // Reset slot_offset so we don't look up any native methods in object, + // because object never takes up the native base-class slot. + lookup.slot_offset = 0; - void mp_load_super_method(qstr attr, mp_obj_t *dest) { - mp_obj_super_t super = {{&mp_type_super}, dest[1], dest[2]}; - mp_load_method(MP_OBJ_FROM_PTR(&super), attr, dest); - } + mp_obj_class_lookup(&lookup, &mp_type_object); +} + +MP_DEFINE_CONST_OBJ_TYPE( + mp_type_super, + MP_QSTR_super, + MP_TYPE_FLAG_NONE, + make_new, super_make_new, + print, super_print, + attr, super_attr + ); + +void mp_load_super_method(qstr attr, mp_obj_t *dest) { + mp_obj_super_t super = {{&mp_type_super}, dest[1], dest[2]}; + mp_load_method(MP_OBJ_FROM_PTR(&super), attr, dest); +} /******************************************************************************/ // subclassing and built-ins specific to types // object and classinfo should be type objects // (but the function will fail gracefully if they are not) - bool mp_obj_is_subclass_fast(mp_const_obj_t object, mp_const_obj_t classinfo) { - for (;;) { - if (object == classinfo) { - return true; - } - - // not equivalent classes, keep searching base classes - - // object should always be a type object, but just return false if it's not - if (!mp_obj_is_type(object, &mp_type_type)) { - return false; - } - - const mp_obj_type_t *self = MP_OBJ_TO_PTR(object); - - if (!MP_OBJ_TYPE_HAS_SLOT(self, parent)) { - // type has no parents - return false; - #if MICROPY_MULTIPLE_INHERITANCE - } else if (((mp_obj_base_t *)MP_OBJ_TYPE_GET_SLOT(self, parent))->type == &mp_type_tuple) { - // get the base objects (they should be type objects) - const mp_obj_tuple_t *parent_tuple = MP_OBJ_TYPE_GET_SLOT(self, parent); - const mp_obj_t *item = parent_tuple->items; - const mp_obj_t *top = item + parent_tuple->len - 1; - - // iterate through the base objects - for (; item < top; ++item) { - if (mp_obj_is_subclass_fast(*item, classinfo)) { - return true; - } - } - - // search last base (simple tail recursion elimination) - object = *item; - #endif - } else { - // type has 1 parent - object = MP_OBJ_FROM_PTR(MP_OBJ_TYPE_GET_SLOT(self, parent)); - } - } - } - - static mp_obj_t mp_obj_is_subclass(mp_obj_t object, mp_obj_t classinfo) { - size_t len; - mp_obj_t *items; - if (mp_obj_is_type(classinfo, &mp_type_type)) { - len = 1; - items = &classinfo; - } else if (mp_obj_is_type(classinfo, &mp_type_tuple)) { - mp_obj_tuple_get(classinfo, &len, &items); - } else { - mp_raise_TypeError(MP_ERROR_TEXT("issubclass() arg 2 must be a class or a tuple of classes")); +bool mp_obj_is_subclass_fast(mp_const_obj_t object, mp_const_obj_t classinfo) { + for (;;) { + if (object == classinfo) { + return true; } - for (size_t i = 0; i < len; i++) { - // We explicitly check for 'object' here since no-one explicitly derives from it - if (items[i] == MP_OBJ_FROM_PTR(&mp_type_object) || mp_obj_is_subclass_fast(object, items[i])) { - return mp_const_true; - } - } - return mp_const_false; - } + // not equivalent classes, keep searching base classes - static mp_obj_t mp_builtin_issubclass(mp_obj_t object, mp_obj_t classinfo) { + // object should always be a type object, but just return false if it's not if (!mp_obj_is_type(object, &mp_type_type)) { - mp_raise_TypeError(MP_ERROR_TEXT("issubclass() arg 1 must be a class")); + return false; } - return mp_obj_is_subclass(object, classinfo); - } - MP_DEFINE_CONST_FUN_OBJ_2(mp_builtin_issubclass_obj, mp_builtin_issubclass); + const mp_obj_type_t *self = MP_OBJ_TO_PTR(object); - static mp_obj_t mp_builtin_isinstance(mp_obj_t object, mp_obj_t classinfo) { - return mp_obj_is_subclass(MP_OBJ_FROM_PTR(mp_obj_get_type(object)), classinfo); - } + if (!MP_OBJ_TYPE_HAS_SLOT(self, parent)) { + // type has no parents + return false; + #if MICROPY_MULTIPLE_INHERITANCE + } else if (((mp_obj_base_t *)MP_OBJ_TYPE_GET_SLOT(self, parent))->type == &mp_type_tuple) { + // get the base objects (they should be type objects) + const mp_obj_tuple_t *parent_tuple = MP_OBJ_TYPE_GET_SLOT(self, parent); + const mp_obj_t *item = parent_tuple->items; + const mp_obj_t *top = item + parent_tuple->len - 1; - MP_DEFINE_CONST_FUN_OBJ_2(mp_builtin_isinstance_obj, mp_builtin_isinstance); + // iterate through the base objects + for (; item < top; ++item) { + if (mp_obj_is_subclass_fast(*item, classinfo)) { + return true; + } + } - mp_obj_t mp_obj_cast_to_native_base(mp_obj_t self_in, mp_const_obj_t native_type) { - const mp_obj_type_t *self_type = mp_obj_get_type(self_in); - - if (MP_OBJ_FROM_PTR(self_type) == native_type) { - return self_in; - } else if (!mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(self_type), native_type)) { - return MP_OBJ_NULL; + // search last base (simple tail recursion elimination) + object = *item; + #endif } else { - mp_obj_instance_t *self = (mp_obj_instance_t *)MP_OBJ_TO_PTR(self_in); - return self->subobj[0]; + // type has 1 parent + object = MP_OBJ_FROM_PTR(MP_OBJ_TYPE_GET_SLOT(self, parent)); } } +} + +static mp_obj_t mp_obj_is_subclass(mp_obj_t object, mp_obj_t classinfo) { + size_t len; + mp_obj_t *items; + if (mp_obj_is_type(classinfo, &mp_type_type)) { + len = 1; + items = &classinfo; + } else if (mp_obj_is_type(classinfo, &mp_type_tuple)) { + mp_obj_tuple_get(classinfo, &len, &items); + } else { + mp_raise_TypeError(MP_ERROR_TEXT("issubclass() arg 2 must be a class or a tuple of classes")); + } + + for (size_t i = 0; i < len; i++) { + // We explicitly check for 'object' here since no-one explicitly derives from it + if (items[i] == MP_OBJ_FROM_PTR(&mp_type_object) || mp_obj_is_subclass_fast(object, items[i])) { + return mp_const_true; + } + } + return mp_const_false; +} + +static mp_obj_t mp_builtin_issubclass(mp_obj_t object, mp_obj_t classinfo) { + if (!mp_obj_is_type(object, &mp_type_type)) { + mp_raise_TypeError(MP_ERROR_TEXT("issubclass() arg 1 must be a class")); + } + return mp_obj_is_subclass(object, classinfo); +} + +MP_DEFINE_CONST_FUN_OBJ_2(mp_builtin_issubclass_obj, mp_builtin_issubclass); + +static mp_obj_t mp_builtin_isinstance(mp_obj_t object, mp_obj_t classinfo) { + return mp_obj_is_subclass(MP_OBJ_FROM_PTR(mp_obj_get_type(object)), classinfo); +} + +MP_DEFINE_CONST_FUN_OBJ_2(mp_builtin_isinstance_obj, mp_builtin_isinstance); + +mp_obj_t mp_obj_cast_to_native_base(mp_obj_t self_in, mp_const_obj_t native_type) { + const mp_obj_type_t *self_type = mp_obj_get_type(self_in); + + if (MP_OBJ_FROM_PTR(self_type) == native_type) { + return self_in; + } else if (!mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(self_type), native_type)) { + return MP_OBJ_NULL; + } else { + mp_obj_instance_t *self = (mp_obj_instance_t *)MP_OBJ_TO_PTR(self_in); + return self->subobj[0]; + } +} /******************************************************************************/ // staticmethod and classmethod types (probably should go in a different file) - static mp_obj_t static_class_method_make_new(const mp_obj_type_t *self, size_t n_args, size_t n_kw, const mp_obj_t *args) { - assert(self == &mp_type_staticmethod || self == &mp_type_classmethod); +// CIRCUITPY-CHANGE: better arg name +static mp_obj_t static_class_method_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { + assert(type == &mp_type_staticmethod || type == &mp_type_classmethod); - mp_arg_check_num(n_args, n_kw, 1, 1, false); + mp_arg_check_num(n_args, n_kw, 1, 1, false); - mp_obj_static_class_method_t *o = m_new_obj(mp_obj_static_class_method_t); - *o = (mp_obj_static_class_method_t) {{self}, args[0]}; - return MP_OBJ_FROM_PTR(o); - } + // CIRCUITPY-CHANGE: Use mp_obj_malloc because it is a Python object + mp_obj_static_class_method_t *o = mp_obj_malloc(mp_obj_static_class_method_t, type); + o->fun = args[0]; + return MP_OBJ_FROM_PTR(o); +} - MP_DEFINE_CONST_OBJ_TYPE( - mp_type_staticmethod, - MP_QSTR_staticmethod, - MP_TYPE_FLAG_NONE, - make_new, static_class_method_make_new - ); +MP_DEFINE_CONST_OBJ_TYPE( + mp_type_staticmethod, + MP_QSTR_staticmethod, + MP_TYPE_FLAG_NONE, + make_new, static_class_method_make_new + ); - MP_DEFINE_CONST_OBJ_TYPE( - mp_type_classmethod, - MP_QSTR_classmethod, - MP_TYPE_FLAG_NONE, - make_new, static_class_method_make_new - ); +MP_DEFINE_CONST_OBJ_TYPE( + mp_type_classmethod, + MP_QSTR_classmethod, + MP_TYPE_FLAG_NONE, + make_new, static_class_method_make_new + ); diff --git a/py/runtime.c b/py/runtime.c index 2916631b13..79a6fc4ed7 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -251,8 +251,7 @@ mp_obj_t MICROPY_WRAP_MP_LOAD_GLOBAL(mp_load_global)(qstr qst) { #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE mp_raise_msg(&mp_type_NameError, MP_ERROR_TEXT("name not defined")); #else - // CIRCUITPY-CHANGE: slight message change - mp_raise_msg_varg(&mp_type_NameError, MP_ERROR_TEXT("name '%q' is not defined"), qst); + mp_raise_msg_varg(&mp_type_NameError, MP_ERROR_TEXT("name '%q' isn't defined"), qst); #endif } } @@ -739,8 +738,8 @@ mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, size_t n_args, size_t n_kw, cons #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(MP_ERROR_TEXT("object not callable")); #else - // CIRCUITPY-CHANGE: use new raise function and different message - mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object is not callable"), mp_obj_get_type_qstr(fun_in)); + // CIRCUITPY-CHANGE: more specific mp_raise + mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object isn't callable"), mp_obj_get_type_qstr(fun_in)); #endif } @@ -1417,9 +1416,9 @@ mp_obj_t mp_getiter(mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf) { #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(MP_ERROR_TEXT("object not iterable")); #else - // CIRCUITPY-CHANGE: raise function + // CIRCUITPY-CHANGE: more specific mp_raise mp_raise_TypeError_varg( - MP_ERROR_TEXT("'%q' object is not iterable"), mp_obj_get_type_qstr(o_in)); + MP_ERROR_TEXT("'%q' object isn't iterable"), mp_obj_get_type_qstr(o_in)); #endif } @@ -1454,8 +1453,8 @@ mp_obj_t mp_iternext_allow_raise(mp_obj_t o_in) { #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(MP_ERROR_TEXT("object not an iterator")); #else - // CIRCUITPY-CHANGE: raise function - mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object is not an iterator"), + // CIRCUITPY-CHANGE: more specific mp_raise + mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object isn't an iterator"), mp_obj_get_type_qstr(o_in)); #endif } @@ -1492,8 +1491,8 @@ mp_obj_t mp_iternext(mp_obj_t o_in) { #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE mp_raise_TypeError(MP_ERROR_TEXT("object not an iterator")); #else - // CIRCUITPY-CHANGE: raise function - mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object is not an iterator"), + // CIRCUITPY-CHANGE: more specific mp_raise + mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object isn't an iterator"), mp_obj_get_type_qstr(o_in)); #endif } diff --git a/shared-module/atexit/__init__.c b/shared-module/atexit/__init__.c index 562b5c3d6b..537a2a9d96 100644 --- a/shared-module/atexit/__init__.c +++ b/shared-module/atexit/__init__.c @@ -28,7 +28,7 @@ void atexit_gc_collect(void) { void shared_module_atexit_register(mp_obj_t *func, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { if (!mp_obj_is_callable(func)) { - mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object is not callable"), mp_obj_get_type_qstr(func)); + mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' object isn't callable"), mp_obj_get_type_qstr(func)); } size_t n_kw_args = (kw_args) ? kw_args->used : 0; atexit_callback_t cb = { diff --git a/tests/micropython/native_with.py.exp b/tests/micropython/native_with.py.exp index 6eef7822fb..7e28663f6f 100644 --- a/tests/micropython/native_with.py.exp +++ b/tests/micropython/native_with.py.exp @@ -5,5 +5,5 @@ __exit__ None None None __init__ __enter__ 1 -__exit__ name 'fail' is not defined None +__exit__ name 'fail' isn't defined None NameError diff --git a/tests/micropython/viper_with.py.exp b/tests/micropython/viper_with.py.exp index 6eef7822fb..7e28663f6f 100644 --- a/tests/micropython/viper_with.py.exp +++ b/tests/micropython/viper_with.py.exp @@ -5,5 +5,5 @@ __exit__ None None None __init__ __enter__ 1 -__exit__ name 'fail' is not defined None +__exit__ name 'fail' isn't defined None NameError