From 8c1784e8c1eac65f66b4a1ecc4b8b0ddd5de9327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 3 Apr 2013 01:17:26 +0200 Subject: Pylint. --- factory/compat.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'factory/compat.py') diff --git a/factory/compat.py b/factory/compat.py index a924de0..84f31b7 100644 --- a/factory/compat.py +++ b/factory/compat.py @@ -25,9 +25,11 @@ import sys -is_python2 = (sys.version_info[0] == 2) +PY2 = (sys.version_info[0] == 2) -if is_python2: - string_types = (str, unicode) +if PY2: + def is_string(obj): + return isinstance(obj, (str, unicode)) else: - string_types = (str,) + def is_string(obj): + return isinstance(obj, str) -- cgit v1.2.3