diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-04-03 01:17:26 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-04-03 01:19:45 +0200 |
commit | 8c1784e8c1eac65f66b4a1ecc4b8b0ddd5de9327 (patch) | |
tree | 0b1d368f114de4235dc3d88e2dfc41b3403d16ef /factory/compat.py | |
parent | 3aee208ee7cdf480cbc173cf3084ce2217a5944f (diff) | |
download | factory-boy-8c1784e8c1eac65f66b4a1ecc4b8b0ddd5de9327.tar factory-boy-8c1784e8c1eac65f66b4a1ecc4b8b0ddd5de9327.tar.gz |
Pylint.
Diffstat (limited to 'factory/compat.py')
-rw-r--r-- | factory/compat.py | 10 |
1 files changed, 6 insertions, 4 deletions
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) |