MCPcopy Index your code
hub / github.com/python/cpython / _check_unpack_options

Function _check_unpack_options

Lib/shutil.py:1262–1277  ·  view source on GitHub ↗

Checks what gets registered as an unpacker.

(extensions, function, extra_args)

Source from the content-addressed store, hash-verified

1260 return formats
1261
1262def _check_unpack_options(extensions, function, extra_args):
1263 """Checks what gets registered as an unpacker."""
1264 # first make sure no other unpacker is registered for this extension
1265 existing_extensions = {}
1266 for name, info in _UNPACK_FORMATS.items():
1267 for ext in info[0]:
1268 existing_extensions[ext] = name
1269
1270 for extension in extensions:
1271 if extension in existing_extensions:
1272 msg = '%s is already registered for "%s"'
1273 raise RegistryError(msg % (extension,
1274 existing_extensions[extension]))
1275
1276 if not callable(function):
1277 raise TypeError('The registered function must be a callable')
1278
1279
1280def register_unpack_format(name, extensions, function, extra_args=None,

Callers 1

register_unpack_formatFunction · 0.85

Calls 2

RegistryErrorClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…