Python 2.7: Check instance on string_types from six instead of str

This commit is contained in:
Konrad Cempura 2018-07-15 23:21:15 +02:00
parent 1b9bb11114
commit 88efa69cfd

View file

@ -1,9 +1,10 @@
"""OpenAPI core schemas util module""" """OpenAPI core schemas util module"""
from distutils.util import strtobool from distutils.util import strtobool
from six import string_types
def forcebool(val): def forcebool(val):
if isinstance(val, str): if isinstance(val, string_types):
val = strtobool(val) val = strtobool(val)
return bool(val) return bool(val)