From 1f9b49c656aed51e2e562d0c86610af97dea94d5 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Fri, 16 May 2014 17:25:53 +0200 Subject: [PATCH] imageinfo.identify(): improve description about exceptions --- picard/util/imageinfo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/picard/util/imageinfo.py b/picard/util/imageinfo.py index 59c1966ee..8aea38724 100644 --- a/picard/util/imageinfo.py +++ b/picard/util/imageinfo.py @@ -45,9 +45,11 @@ def identify(data): - mimetype - extension - data length - It will raise 'IdentificationError' if: - - not enough data (< 16 bytes) - - format isn't recognized + Exceptions: + - `NotEnoughData` if data has less than 16 bytes. + - `UnrecognizedFormat` if data isn't recognized as a known format. + - `UnexpectedError` if unhandled cases (shouldn't happen). + - `IdentificationError` is parent class for all preceding exceptions. """ datalen = len(data)