Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
grumpy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
grumpy
Commits
b5f04d53
Commit
b5f04d53
authored
Feb 15, 2017
by
Dong-hee Na
Committed by
Dylan Trotter
Feb 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch from os.Stderr to Stderr. (#249)
parent
39a7d60b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
runtime/core.go
runtime/core.go
+1
-2
runtime/module.go
runtime/module.go
+3
-3
runtime/module_test.go
runtime/module_test.go
+3
-3
runtime/weakref.go
runtime/weakref.go
+1
-2
No files found.
runtime/core.go
View file @
b5f04d53
...
...
@@ -17,7 +17,6 @@ package grumpy
import
(
"fmt"
"log"
"os"
"reflect"
)
...
...
@@ -756,7 +755,7 @@ func StartThread(callable *Object) {
if
raised
!=
nil
{
s
=
raised
.
String
()
}
fmt
.
Fprintf
(
os
.
Stderr
,
s
)
Stderr
.
writeString
(
s
)
}
}()
}
...
...
runtime/module.go
View file @
b5f04d53
...
...
@@ -289,7 +289,7 @@ func RunMain(code *Code) int {
m
.
state
=
moduleStateInitializing
f
:=
NewRootFrame
()
if
raised
:=
SysModules
.
SetItemString
(
f
,
"__main__"
,
m
.
ToObject
());
raised
!=
nil
{
fmt
.
Fprint
(
os
.
Stderr
,
raised
.
String
())
Stderr
.
writeString
(
raised
.
String
())
}
_
,
e
:=
code
.
Eval
(
f
,
m
.
Dict
(),
nil
,
nil
)
if
e
==
nil
{
...
...
@@ -300,7 +300,7 @@ func RunMain(code *Code) int {
if
raised
!=
nil
{
s
=
e
.
String
()
}
fmt
.
Fprint
(
os
.
Stderr
,
s
)
Stderr
.
writeString
(
s
)
return
1
}
f
.
RestoreExc
(
nil
,
nil
)
...
...
@@ -315,7 +315,7 @@ func RunMain(code *Code) int {
return
0
}
if
s
,
raised
:=
ToStr
(
f
,
o
);
raised
==
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
s
.
Value
()
)
Stderr
.
writeString
(
s
.
Value
()
+
"
\n
"
)
}
return
1
}
runtime/module_test.go
View file @
b5f04d53
...
...
@@ -307,15 +307,15 @@ func TestRunMain(t *testing.T) {
}
func
runMainAndCaptureStderr
(
code
*
Code
)
(
int
,
string
,
error
)
{
oldStderr
:=
os
.
Stderr
oldStderr
:=
Stderr
defer
func
()
{
os
.
Stderr
=
oldStderr
Stderr
=
oldStderr
}()
r
,
w
,
err
:=
os
.
Pipe
()
if
err
!=
nil
{
return
0
,
""
,
err
}
os
.
Stderr
=
w
Stderr
=
NewFileFromFD
(
w
.
Fd
())
c
:=
make
(
chan
int
)
go
func
()
{
defer
w
.
Close
()
...
...
runtime/weakref.go
View file @
b5f04d53
...
...
@@ -16,7 +16,6 @@ package grumpy
import
(
"fmt"
"os"
"reflect"
"runtime"
"sync"
...
...
@@ -194,7 +193,7 @@ func weakRefFinalizeReferent(o *Object) {
if
raised
!=
nil
{
s
=
raised
.
String
()
}
fmt
.
Fprint
(
os
.
Stderr
,
s
)
Stderr
.
writeString
(
s
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment