mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 19:18:36 +00:00
Python 2.7: Check instance on string_types from six instead of str
This commit is contained in:
parent
1b9bb11114
commit
88efa69cfd
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue