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
Errno::ECHILD thrown from Process.waitpid, some Process methods #732
Conversation
) | ||
space.globals.set(space, "$?", w_status) | ||
return space.newint(pid) | ||
except OSError as ex: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the minim amount of code should be inside of the try
block.
@alex feel free to merge if Travis says it's green and you haven't got further comments. |
try: | ||
name = _errno_for_oserror_map[exc.errno] | ||
except KeyError: | ||
raise NotImplementedError("no such errno: %s" % exc.errno) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably just raise a normal SystemCallError
if we don't know the specific sucblass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest this whole function should be merged with the other error_for_oserror
function.
try: | ||
name = _errno_for_oserror_map[exc.errno] | ||
type = space.find_const(space.find_const(callee, "Errno"), name) | ||
except KeyError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the name = ...
line should be in the try
/except
block, you can use the try
/except
/else
form to acheive that.
Errno::ECHILD thrown from Process.waitpid, some Process methods
No description provided.