diff options
| author | John R. Lenton <jlenton@gmail.com> | 2014-01-05 01:57:54 +0000 |
|---|---|---|
| committer | John R. Lenton <jlenton@gmail.com> | 2014-01-05 01:57:54 +0000 |
| commit | 7e73a8fd09a8070a3bbb90d2ddc4f04af4e2828a (patch) | |
| tree | 606e074a1955f381c68d1689946066e9eb1a5a47 /py/emitpass1.c | |
| parent | 5d4a8213395b1e27d303379772c90b3b0adc82d5 (diff) | |
| parent | 45b43c21c4f8e30dcff00c2429eddba20ca002aa (diff) | |
Merge remote-tracking branch 'upstream/master' into list_index
Diffstat (limited to 'py/emitpass1.c')
| -rw-r--r-- | py/emitpass1.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/py/emitpass1.c b/py/emitpass1.c index 1c11241e0..f78ec7e27 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; |
