webelem: Refuse to wrap a wrapper in WebElementWrapper.

This commit is contained in:
Florian Bruhin 2014-09-19 12:28:23 +02:00
parent a0cc55037e
commit bc884ed51e

View File

@ -70,6 +70,8 @@ class WebElementWrapper(collections.abc.MutableMapping):
"""A wrapper around QWebElement to make it more intelligent."""
def __init__(self, elem):
if isinstance(elem, self.__class__):
raise TypeError("Trying to wrap a wrapper!")
if elem.isNull():
raise IsNullError('{} is a null element!'.format(elem))
self._elem = elem