Curses vs Urwid version 2 (patch_v2_curses_vs_urwid.diff)

I was of course wrong with the first patch. Improved error message...

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 10:18:51 2014 +0200
@@ -59,11 +59,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)
+            tuple(int(x) for x in URWID_VERSION.split('.')) < (1, 0, 0):
+            raise ApplicationError('The "curses" interface can not be used '
+                             'with old installed urwid version %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':