python-modernize -f libmodernize.fixes.fix_basestring
This commit is contained in:
parent
7f6b717eb6
commit
5ad9027320
4 changed files with 18 additions and 17 deletions
|
|
@ -33,6 +33,7 @@ import traceback
|
|||
from ConfigParser import RawConfigParser
|
||||
from koji.server import ServerError, ServerRedirect
|
||||
from koji.util import dslice
|
||||
import six
|
||||
|
||||
|
||||
class URLNotFound(ServerError):
|
||||
|
|
@ -397,14 +398,14 @@ class Dispatcher(object):
|
|||
else:
|
||||
# last one wins
|
||||
headers[key] = (name, value)
|
||||
if isinstance(result, basestring):
|
||||
if isinstance(result, six.string_types):
|
||||
headers.setdefault('content-length', ('Content-Length', str(len(result))))
|
||||
headers.setdefault('content-type', ('Content-Type', 'text/html'))
|
||||
headers = list(headers.values()) + extra
|
||||
self.logger.debug("Headers:")
|
||||
self.logger.debug(koji.util.LazyString(pprint.pformat, [headers]))
|
||||
start_response(status, headers)
|
||||
if isinstance(result, basestring):
|
||||
if isinstance(result, six.string_types):
|
||||
result = [result]
|
||||
return result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue