summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-01-25 18:49:19 (GMT)
committerBrett Cannon <brett@python.org>2013-01-25 18:49:19 (GMT)
commit686e880f20a38918c8341aaf6bc14420890d36a2 (patch)
tree16c919ed347cc0ecb437984c2bcbf767b73ab9d5 /Lib/importlib
parent90c8d06d687eed87fa61bf6bcc3a40beeaef39cd (diff)
downloadcpython-686e880f20a38918c8341aaf6bc14420890d36a2.zip
cpython-686e880f20a38918c8341aaf6bc14420890d36a2.tar.gz
cpython-686e880f20a38918c8341aaf6bc14420890d36a2.tar.bz2
Touch up exception messaging
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 49263a5..344ef84 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -639,21 +639,21 @@ def _validate_bytecode_header(data, source_stats=None, name=None, path=None):
exc_details['name'] = name
else:
# To prevent having to make all messages have a conditional name.
- name = 'bytecode'
+ name = '<bytecode>'
if path is not None:
exc_details['path'] = path
magic = data[:4]
raw_timestamp = data[4:8]
raw_size = data[8:12]
if magic != _MAGIC_BYTES:
- msg = 'bad magic number in {!r}: {!r}'.format(name, magic)
+ msg = 'incomplete magic number in {!r}: {!r}'.format(name, magic)
raise ImportError(msg, **exc_details)
elif len(raw_timestamp) != 4:
- message = 'bad timestamp in {!r}'.format(name)
+ message = 'incomplete timestamp in {!r}'.format(name)
_verbose_message(message)
raise EOFError(message)
elif len(raw_size) != 4:
- message = 'bad size in {!r}'.format(name)
+ message = 'incomplete size in {!r}'.format(name)
_verbose_message(message)
raise EOFError(message)
if source_stats is not None: