summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-04 21:34:49 (GMT)
committerBrett Cannon <brett@python.org>2013-06-04 21:34:49 (GMT)
commitaf38f5a5032e49d527adcb9c594abfeba5d9b9b2 (patch)
tree75b00817e3770f13aadaabe4acea9ed497e38c5e /Lib/importlib/_bootstrap.py
parent0b81111b18790e5d95cb84a09d15aadfb8a1dadf (diff)
downloadcpython-af38f5a5032e49d527adcb9c594abfeba5d9b9b2.zip
cpython-af38f5a5032e49d527adcb9c594abfeba5d9b9b2.tar.gz
cpython-af38f5a5032e49d527adcb9c594abfeba5d9b9b2.tar.bz2
Tweak at the suggestion of Ezio Melotti for exception messages when
EOF is hit while trying to read the header of a bytecode file.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r--Lib/importlib/_bootstrap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index f8a1b0b..62be36a 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -668,11 +668,11 @@ def _validate_bytecode_header(data, source_stats=None, name=None, path=None):
_verbose_message(message)
raise ImportError(message, **exc_details)
elif len(raw_timestamp) != 4:
- message = 'incomplete timestamp in {!r}'.format(name)
+ message = 'reached EOF while reading magic number in {!r}'.format(name)
_verbose_message(message)
raise EOFError(message)
elif len(raw_size) != 4:
- message = 'incomplete size in {!r}'.format(name)
+ message = 'reached EOF while reading size in {!r}'.format(name)
_verbose_message(message)
raise EOFError(message)
if source_stats is not None: