Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Duplicated error type. #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
corona10 opened this issue Sep 2, 2018 · 2 comments
Closed

Duplicated error type. #23

corona10 opened this issue Sep 2, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@corona10
Copy link
Collaborator

corona10 commented Sep 2, 2018

Got:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
TypeError: TypeError: 'all() takes exactly 1 argument (3 given)'

Expected:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
TypeError: 'all() takes exactly 1 argument (3 given)'
@ncw ncw added the bug Something isn't working label Sep 3, 2018
@corona10
Copy link
Collaborator Author

@ncw

vm.curexc.Type = exception.Type()

vm.curexc.Value = exception

To fix this issue, vm.curexc.Typeshould not be refernced since vm.curexc.Value
already build the exception message.

But I don't know where it works, can you guide it please?
Thanks!

@ncw
Copy link
Collaborator

ncw commented Nov 23, 2018

I think you want to change this in py/exception.go

// Dump a traceback for exc to w
func (exc *ExceptionInfo) TracebackDump(w io.Writer) {
	if exc == nil {
		fmt.Fprintf(w, "Traceback <nil>\n")
		return
	}
	fmt.Fprintf(w, "Traceback (most recent call last):\n")
	exc.Traceback.TracebackDump(w)
	name := "<nil>"
	if exc.Type != nil {
		name = exc.Type.Name
	}
	fmt.Fprintf(w, "%v: %v\n", name, exc.Value)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants