Skip to content

Commit

Permalink
Update print file argument
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLBuehler authored Dec 4, 2022
1 parent c67cc4a commit 2e842a1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions builtins/builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ object* builtin_print(object* self, object* args){
object* sep_=dict_get_opti_deref(args, str_new_fromstr("sep"));
object* end=dict_get_opti_deref(args, str_new_fromstr("end"));
object* file=dict_get_opti_deref(args, str_new_fromstr("file"));
if (file==NULL){
FPLDECREF(vm->exception);
vm->exception=NULL;
if (file==orig_Stdout){
FPLDECREF(file);
FPLINCREF(Stdout);
file=Stdout;
}

object* o=object_getattr_deref(file, str_new_fromstr("read"));
if (o==NULL){
FPLDECREF(vm->exception);
Expand Down

0 comments on commit 2e842a1

Please sign in to comment.