Skip to content
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

Merged
merged 8 commits into from May 27, 2013
Merged

Errno::ECHILD thrown from Process.waitpid, some Process methods #732

merged 8 commits into from May 27, 2013

Conversation

jstepien
Copy link
Contributor

No description provided.

)
space.globals.set(space, "$?", w_status)
return space.newint(pid)
except OSError as ex:
Copy link
Member

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.

@jstepien
Copy link
Contributor Author

@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)
Copy link
Member

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.

Copy link
Member

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:
Copy link
Member

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.

alex added a commit that referenced this pull request May 27, 2013
Errno::ECHILD thrown from Process.waitpid, some Process methods
@alex alex merged commit 9c3d418 into topazproject:master May 27, 2013
@jstepien jstepien deleted the errno-echild branch May 28, 2013 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants