From d43351c5784ba59ee36bebfa83f30cc7ae0b45fe Mon Sep 17 00:00:00 2001 From: JGoutin Date: Fri, 9 Oct 2015 12:21:13 +0200 Subject: [PATCH] Import fail if python is runned with -OO Hello, This fix a crash on skimage import if Python compilation optimization is set to 2 (Remove docstrings / Run python with -OO argument) --- skimage/io/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/skimage/io/__init__.py b/skimage/io/__init__.py index d0ec1f43..b6ec5875 100644 --- a/skimage/io/__init__.py +++ b/skimage/io/__init__.py @@ -10,6 +10,7 @@ from .collection import * from ._io import * from ._image_stack import * +import sys reset_plugins() @@ -58,5 +59,5 @@ def _update_doc(doc): return doc - -__doc__ = _update_doc(__doc__) +if sys.flags.optimize < 2: + __doc__ = _update_doc(__doc__)