Skip to content

Commit 6227b66

Browse files
Machinexa2AutomatedTester
Machinexa2
andauthored
Further improve imports (#8951)
Co-authored-by: David Burns <[email protected]>
1 parent 4d1d1e2 commit 6227b66

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

py/selenium/webdriver/remote/webelement.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
import base64
19-
import hashlib
2018
import os
19+
from base64 import b64decode
20+
from hashlib import md5 as md5_hash
2121
import pkgutil
2222
import warnings
2323
import zipfile
@@ -637,7 +637,7 @@ def screenshot_as_png(self):
637637
638638
element_png = element.screenshot_as_png
639639
"""
640-
return base64.b64decode(self.screenshot_as_base64.encode('ascii'))
640+
return b64decode(self.screenshot_as_base64.encode('ascii'))
641641

642642
def screenshot(self, filename):
643643
"""
@@ -762,7 +762,7 @@ def find_elements(self, by=By.ID, value=None):
762762
{"using": by, "value": value})['value']
763763

764764
def __hash__(self):
765-
return int(hashlib.md5(self._id.encode('utf-8')).hexdigest(), 16)
765+
return int(md5_hash(self._id.encode('utf-8')).hexdigest(), 16)
766766

767767
def _upload(self, filename):
768768
fp = BytesIO()

0 commit comments

Comments
 (0)