Patch using urwid.VERSION (the numversion) (patch_v3_curses_vs_urwid.diff)

urwid.VERSION is the numeric version, better solution...

download
# HG changeset patch
# User "Emile Anclin" <emile.anclin@laposte.net>
# Parent 385a78f8e369687b461cf9fe017851aad8a22db1
[curses] fix broken urwid version check (closes #259133)

diff -r 385a78f8e369 hgviewlib/curses/application.py
--- a/hgviewlib/curses/application.py	Fri Jan 31 11:36:52 2014 -0800
+++ b/hgviewlib/curses/application.py	Wed Jul 30 11:55:01 2014 +0200
@@ -21,7 +21,7 @@
 import logging
 import sys
 
-from urwid import AttrWrap, MainLoop, __version__ as URWID_VERSION
+from urwid import AttrWrap, MainLoop, VERSION as URWID_VERSION
 
 from hgviewlib.application import HgViewApplication, ApplicationError
 from hgviewlib.curses.hgrepoviewer import RepoViewer
@@ -58,12 +58,10 @@
 
     def get_screen(self):
         """return the screen instance to use"""
-        if self.opts.interface == 'curses' and \
-            map(int, URWID_VERSION.split('.')) < (1,0,0):
-            raise ApplicationError('The "curses" interface could not be use '
-                                   'with old urwid version ()%s < 1.0.0.'
-                                   'Use the"raw" interface' %
-                                   URWID_VERSION)
+        if self.opts.interface == 'curses' and URWID_VERSION < (1, 2, 0):
+            raise ApplicationError('The "curses" interface can not be used '
+                             'with old installed urwid version %s.%s.%s < 1.0.0. '
+                             'Use the "raw" interface' % URWID_VERSION)
         if self.opts.interface == 'raw':
             from urwid.raw_display import Screen
         elif self.opts.interface == 'curses':