summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitpass1.c
diff options
context:
space:
mode:
authorJohn R. Lenton <jlenton@gmail.com>2014-01-05 22:29:03 +0000
committerJohn R. Lenton <jlenton@gmail.com>2014-01-05 22:29:03 +0000
commitba3f87c94776538fece5e87ff1d7de547930397a (patch)
tree3112b328cff278168a1ef48fc37a65778ea9324a /py/emitpass1.c
parent6e1e98f8648d327098a03ce8d175c9854dd06cc8 (diff)
parent12e2656472bf53e467c066eda6f3e177a97210ca (diff)
downloadmicropython-ba3f87c94776538fece5e87ff1d7de547930397a.tar.gz
micropython-ba3f87c94776538fece5e87ff1d7de547930397a.zip
Merge remote-tracking branch 'upstream/master' into list_reverse
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;