Skip to content

Commit

Permalink
[py] Only attempt to remove the profile path if one was specified
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Oct 21, 2016
1 parent 7e255eb commit 9157c70
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions py/selenium/webdriver/firefox/webdriver.py
Expand Up @@ -186,12 +186,13 @@ def quit(self):
self.service.stop()
else:
self.binary.kill()
try:
shutil.rmtree(self.profile.path)
if self.profile.tempfolder is not None:
shutil.rmtree(self.profile.tempfolder)
except Exception as e:
print(str(e))
if self.profile is not None:
try:
shutil.rmtree(self.profile.path)
if self.profile.tempfolder is not None:
shutil.rmtree(self.profile.tempfolder)
except Exception as e:
print(str(e))

@property
def firefox_profile(self):
Expand Down

0 comments on commit 9157c70

Please sign in to comment.