Antoine Pitrou added the comment:

Wouldn't it be simpler to write (untested):

def skipUnlessCompressionModule(name):
    """
    Skip if the specified compression module is not available.  Must e a
    string, currently any of 'gzip', 'bz2', or 'lzma'.
    """
    return unittest.skipUnless(globals()[name],
                               '{} not available'.format(name))

?

----------
nosy: +pitrou

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17689>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to