Commit 45778f34 authored by Romain Bignon's avatar Romain Bignon

fix command 'inspect' to don't crash if there isn't any browser

parent 7d356f50
......@@ -818,10 +818,13 @@ class ReplApplication(Cmd, ConsoleApplication):
print >>sys.stderr, 'No backend found for "%s"' % backend_name
return 1
backend = backends.pop()
if not hasattr(backend, '_browser'):
print >>sys.stderr, 'No browser created for backend "%s" yet. Please invoke a command before.' %
if not backend.browser:
print >>sys.stderr, 'No browser created for backend "%s".' %
return 1
browser = backend._browser
if not
print >>sys.stderr, 'The browser of %s is not on any page.' %
return 1
browser = backend.browser
data = browser.parser.tostring(
from webkit_mechanize_browser.browser import Browser
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment