From 7c3e15d99ff92e9ef13d5c0fbe3d73a2518aaf1a Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 21 May 2013 23:06:57 +0000 Subject: [PATCH] Check for basestring type in Python2.x, and type str in Python3.x. --- src/_parsers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_parsers.py b/src/_parsers.py index a6bddcd..0cd6f4a 100644 --- a/src/_parsers.py +++ b/src/_parsers.py @@ -484,7 +484,8 @@ def _sanitise(*args): log.warn("_check_option(): %s" % error.message) else: safe_option += (flag + " ") - if isinstance(value, str): + if (not _util._py3k and isinstance(value, basestring)) \ + or (_util._py3k and isinstance(value, str)): values = value.split(' ') for v in values: val = _fix_unsafe(v)