tag 730166 + patch
thanks

On Fri, Nov 22, 2013 at 09:02:55AM +0100, Mathieu Malaterre wrote:
> For some reason tifffile does not work anymore:
> 
> $ tifffile
> Traceback (most recent call last):
>   File "/usr/bin/tifffile", line 7, in <module>
>     sys.exit(tifffile.main())
>   File "/usr/lib/python2.6/dist-packages/tifffile.py", line 2976, in main
>     description=search_doc("\n\n([^|]*?)\n\n", ''),
>   File "/usr/lib/python2.6/dist-packages/tifffile.py", line 2973, in <lambda>
>     search_doc = lambda r, d: re.search(r, __doc__).group(1) if __doc__ else d
> AttributeError: 'NoneType' object has no attribute 'group'

I think it'd make sense to just take the first line of the module
docstring as documentation:

--- tifffile.py.orig    2013-11-22 18:53:39.107471300 +0100
+++ tifffile.py 2013-11-22 19:06:36.245232148 +0100
@@ -2973,7 +2973,7 @@
     search_doc = lambda r, d: re.search(r, __doc__).group(1) if __doc__ else d
     parser = optparse.OptionParser(
         usage="usage: %prog [options] path",
-        description=search_doc("\n\n([^|]*?)\n\n", ''),
+        description=search_doc("^([^\n]+)", ""),
         version="%%prog %s" % search_doc(":Version: (.*)", "Unknown"))
     opt = parser.add_option
     opt('-p', '--page', dest='page', type='int', default=-1,

Kind regards
Philipp Kern

Attachment: signature.asc
Description: Digital signature

Reply via email to