File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
py/selenium/webdriver/common Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -93,10 +93,16 @@ def is_connectable(self):
93
93
def send_remote_shutdown_command (self ):
94
94
try :
95
95
from urllib import request as url_request
96
+ URLError = url_request .URLError
96
97
except ImportError :
97
98
import urllib2 as url_request
99
+ import urllib2
100
+ URLError = urllib2 .URLError
98
101
99
- url_request .urlopen ("http://127.0.0.1:%d/shutdown" % self .port )
102
+ try :
103
+ url_request .urlopen ("http://127.0.0.1:%d/shutdown" % self .port )
104
+ except URLError :
105
+ return
100
106
count = 0
101
107
while self .is_connectable ():
102
108
if count == 30 :
@@ -134,6 +140,7 @@ def stop(self):
134
140
self .process .terminate ()
135
141
self .process .kill ()
136
142
self .process .wait ()
143
+ self .process = None
137
144
except OSError :
138
145
# kill may not be available under windows environment
139
146
pass
You can’t perform that action at this time.
0 commit comments