avoid harcoded check for selector type

This commit is contained in:
Elias Dorneles 2015-08-06 23:31:06 -03:00
parent 94c3a345b7
commit 67c98b185b
1 changed files with 1 additions and 4 deletions

View File

@ -17,10 +17,7 @@ __all__ = ['Selector', 'SelectorList']
def _st(response, st):
if st is None:
return 'xml' if isinstance(response, XmlResponse) else 'html'
elif st in ('xml', 'html'):
return st
else:
raise ValueError('Invalid type: %s' % st)
return st
def _response_from_text(text, st):