summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-03-20 17:48:03 -0500
committerJeff Epler <jepler@gmail.com>2020-03-20 17:57:28 -0500
commit9d2270a979b3d3ce107a2ea830b6bf7beecb1fdc (patch)
tree86857c14ff70e7f66aeb7053c3c85f90c303ef57
parent98f5cf25a5a3da98bba099a3ce375b286942bb12 (diff)
runtime: Improve error message when setting read-only property
Formerly, if you wrote SPI.frequency = 0 you would get the sightly erroneous error message AttributeError: 'SPI' object has no attribute 'frequency' In this case, a better message would read AttributeError: 'SPI' object cannot assign attribute 'frequency' This new message will both be used in the case where the attribute doesn't exist at all (and the object has no dynamic attributes; most instances of built in types behave this way), or if the attribute exists but is read-only.
-rw-r--r--locale/ID.po6
-rw-r--r--locale/circuitpython.pot6
-rw-r--r--locale/de_DE.po6
-rw-r--r--locale/en_US.po6
-rw-r--r--locale/en_x_pirate.po6
-rw-r--r--locale/es.po6
-rw-r--r--locale/fil.po6
-rw-r--r--locale/fr.po6
-rw-r--r--locale/it_IT.po6
-rw-r--r--locale/ko.po6
-rw-r--r--locale/pl.po6
-rw-r--r--locale/pt_BR.po6
-rw-r--r--locale/zh_Latn_pinyin.po6
-rw-r--r--py/runtime.c2
14 files changed, 66 insertions, 14 deletions
diff --git a/locale/ID.po b/locale/ID.po
index b68e9d090..8c5725428 100644
--- a/locale/ID.po
+++ b/locale/ID.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -134,6 +134,10 @@ msgstr ""
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot
index 352178a93..53ee64795 100644
--- a/locale/circuitpython.pot
+++ b/locale/circuitpython.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -133,6 +133,10 @@ msgstr ""
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr ""
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 3794537a9..df62a978c 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: Pascal Deneaux\n"
"Language-Team: Sebastian Plamauer, Pascal Deneaux\n"
@@ -135,6 +135,10 @@ msgstr "'%s' integer %d ist nicht im Bereich %d..%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/en_US.po b/locale/en_US.po
index 9d88663aa..0a2f870e7 100644
--- a/locale/en_US.po
+++ b/locale/en_US.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -133,6 +133,10 @@ msgstr ""
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr ""
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po
index e5b135bf0..ae56216d7 100644
--- a/locale/en_x_pirate.po
+++ b/locale/en_x_pirate.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: @sommersoft, @MrCertainly\n"
@@ -135,6 +135,10 @@ msgstr ""
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr ""
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/es.po b/locale/es.po
index 214496ed3..2f2b206b2 100644
--- a/locale/es.po
+++ b/locale/es.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-08-24 22:56-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -135,6 +135,10 @@ msgstr "'%s' entero %d no esta dentro del rango %d..%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/fil.po b/locale/fil.po
index 43fd08686..f8c1471d5 100644
--- a/locale/fil.po
+++ b/locale/fil.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n"
@@ -136,6 +136,10 @@ msgstr "'%s' integer %d ay wala sa sakop ng %d..%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' integer 0x%x ay wala sa mask na sakop ng 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/fr.po b/locale/fr.po
index aab2f8d49..56f20106b 100644
--- a/locale/fr.po
+++ b/locale/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2019-04-14 20:05+0100\n"
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
"Language-Team: fr\n"
@@ -137,6 +137,10 @@ msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/it_IT.po b/locale/it_IT.po
index 0378ef77c..1b31c5645 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
"Language-Team: \n"
@@ -135,6 +135,10 @@ msgstr "intero '%s' non è nell'intervallo %d..%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "intero '%s' non è nell'intervallo %d..%d"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/ko.po b/locale/ko.po
index 949b8cc62..575a88b62 100644
--- a/locale/ko.po
+++ b/locale/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2019-05-06 14:22-0700\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -135,6 +135,10 @@ msgstr ""
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr ""
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/pl.po b/locale/pl.po
index b25e42fe5..ad726ac7f 100644
--- a/locale/pl.po
+++ b/locale/pl.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
"Language-Team: pl\n"
@@ -134,6 +134,10 @@ msgstr "'%s' liczba %d poza zakresem %d..%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' liczba 0x%x nie pasuje do maski 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index ec4658477..48af7b797 100644
--- a/locale/pt_BR.po
+++ b/locale/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2018-10-02 21:14-0000\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -135,6 +135,10 @@ msgstr ""
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr ""
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr ""
diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po
index 8fbd53d70..5e545a66f 100644
--- a/locale/zh_Latn_pinyin.po
+++ b/locale/zh_Latn_pinyin.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-03-17 16:39-0500\n"
+"POT-Creation-Date: 2020-03-20 17:57-0500\n"
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
"Last-Translator: hexthat\n"
"Language-Team: Chinese Hanyu Pinyin\n"
@@ -140,6 +140,10 @@ msgstr "'%s' zhěngshù %d bùzài fànwéi nèi %d.%d"
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
msgstr "'%s' zhěngshù 0x%x bù shìyòng yú yǎn mǎ 0x%x"
+#: py/runtime.c
+msgid "'%s' object cannot assign attribute '%q'"
+msgstr ""
+
#: py/proto.c
msgid "'%s' object does not support '%q'"
msgstr "'%s' duì xiàng bù zhīchí '%q'"
diff --git a/py/runtime.c b/py/runtime.c
index c1c311ae4..59dcbc7a1 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1172,7 +1172,7 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) {
mp_raise_AttributeError(translate("no such attribute"));
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError,
- translate("'%s' object has no attribute '%q'"),
+ translate("'%s' object cannot assign attribute '%q'"),
mp_obj_get_type_str(base), attr));
}
}