Fix some py3k warnings in the standard library.

This commit is contained in:
Florent Xicluna 2010-03-07 12:14:25 +00:00
parent 2a4ab81633
commit 1f3b4e12e8
9 changed files with 45 additions and 40 deletions

View file

@ -10,6 +10,7 @@ import stat
from os.path import abspath
import fnmatch
from warnings import warn
import collections
try:
from pwd import getpwnam
@ -500,7 +501,7 @@ def register_archive_format(name, function, extra_args=None, description=''):
"""
if extra_args is None:
extra_args = []
if not callable(function):
if not isinstance(function, collections.Callable):
raise TypeError('The %s object is not callable' % function)
if not isinstance(extra_args, (tuple, list)):
raise TypeError('extra_args needs to be a sequence')