Skip to content

Commit

Permalink
Ensure you can close stream before attempting to.
Browse files Browse the repository at this point in the history
Signed-off-by: AutomatedTester <david.burns@theautomatedtester.co.uk>
  • Loading branch information
Ryan Fitzpatrick authored and AutomatedTester committed Jan 14, 2016
1 parent 4029b29 commit cc07382
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions py/selenium/webdriver/common/service.py
Expand Up @@ -121,8 +121,13 @@ def stop(self):

try:
if self.process:
self.process.stdout.close()
self.process.stderr.close()
for stream in [self.process.stdin,
self.process.stdout,
self.process.stderr]:
try:
stream.close()
except AttributeError:
pass
self.process.terminate()
self.process.kill()
self.process.wait()
Expand Down

2 comments on commit cc07382

@sgloutnikov
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! This fixed driver.quit() breaking for me in 2.4.9.

@yanyuchka
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Thank you for this fix!

Please sign in to comment.