Skip to content

Commit b5bdbb3

Browse files
committed
Merge pull request astropy#196 from astrofrog/fix-undefined
Fix undefined usage of ‘six’
2 parents 8888a23 + 9ecd1b8 commit b5bdbb3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎astropy_helpers/utils.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
invalidate_caches = lambda: None
3131

3232

33+
# Python 2/3 compatibility
34+
if sys.version_info[0] < 3:
35+
string_types = (str, unicode)
36+
else:
37+
string_types = (str,)
38+
39+
3340
# Note: The following Warning subclasses are simply copies of the Warnings in
3441
# Astropy of the same names.
3542
class AstropyWarning(Warning):
@@ -635,7 +642,7 @@ def minversion(module, version, inclusive=True, version_path='__version__'):
635642

636643
if isinstance(module, types.ModuleType):
637644
module_name = module.__name__
638-
elif isinstance(module, six.string_types):
645+
elif isinstance(module, string_types):
639646
module_name = module
640647
try:
641648
module = resolve_name(module_name)

0 commit comments

Comments
 (0)