Skip to content

Commit

Permalink
Set default value for PhantomJS process reference
Browse files Browse the repository at this point in the history
In the PhantomJS Service class, the process attribute can be undefined
if something goes wrong.  In that case, the destructor (__del__)
raises an AttributeError.

Signed-off-by: Andreas Tolfsen <ato@mozilla.com>
  • Loading branch information
dbrgn authored and andreastt committed Nov 25, 2014
1 parent f639196 commit a045504
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions py/selenium/webdriver/phantomjs/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self, executable_path, port=0, service_args=None, log_path=None):
self.service_args=service_args[:]
self.service_args.insert(0, self.path)
self.service_args.append("--webdriver=%d" % self.port)
self.process = None
if not log_path:
log_path = "ghostdriver.log"
self._log = open(log_path, 'w')
Expand Down

0 comments on commit a045504

Please sign in to comment.