summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitpass1.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-04 20:21:15 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-04 20:21:15 +0000
commit71c5181a8dfa69ba9f5ca322a3aba0660be2e166 (patch)
tree77aae5a9008f269276bda9c433235f7e11b57ed4 /py/emitpass1.c
parente9906ac3d771a312b05d76e42aee8e806dd0d128 (diff)
downloadmicropython-71c5181a8dfa69ba9f5ca322a3aba0660be2e166.tar.gz
micropython-71c5181a8dfa69ba9f5ca322a3aba0660be2e166.zip
Convert Python types to proper Python type hierarchy.
Now much more inline with how CPython does types.
Diffstat (limited to 'py/emitpass1.c')
-rw-r--r--py/emitpass1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/emitpass1.c b/py/emitpass1.c
index 1c11241e0d..f78ec7e27e 100644
--- a/py/emitpass1.c
+++ b/py/emitpass1.c
@@ -7,6 +7,7 @@
#include "misc.h"
#include "mpconfig.h"
+#include "mpqstr.h"
#include "lexer.h"
#include "parse.h"
#include "scope.h"
@@ -44,9 +45,9 @@ static void emit_pass1_load_id(emit_t *emit, qstr qstr) {
bool added;
id_info_t *id = scope_find_or_add_id(emit->scope, qstr, &added);
if (added) {
- if (strcmp(qstr_str(qstr), "AssertionError") == 0) {
- id->kind = ID_INFO_KIND_GLOBAL_EXPLICIT;
+ if (qstr == MP_QSTR_AssertionError) {
// TODO how much of a hack is this?
+ id->kind = ID_INFO_KIND_GLOBAL_EXPLICIT;
} else if (strcmp(qstr_str(qstr), "super") == 0 && emit->scope->kind == SCOPE_FUNCTION) {
// special case, super is a global, and also counts as use of __class__
id->kind = ID_INFO_KIND_GLOBAL_EXPLICIT;