mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Fix some py3k warnings in the standard library.
This commit is contained in:
parent
2a4ab81633
commit
1f3b4e12e8
9 changed files with 45 additions and 40 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue