[py3k] unbound methods (related to #7794111)
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 21 Oct 2015 12:15:41 +0200
changeset 346 bc416e82ec14
parent 345 e7672f2c187e
child 347 5926af2f084e
[py3k] unbound methods (related to #7794111) Python 3 no longer differenciates unbound methods from regular functions. Bottom line: the 'im_func' special attribute no longer exists.
__pkginfo__.py
cubicweb-blog.spec
debian/control
views/entry.py
--- a/__pkginfo__.py	Wed Sep 16 11:08:21 2015 +0200
+++ b/__pkginfo__.py	Wed Oct 21 12:15:41 2015 +0200
@@ -19,7 +19,8 @@
     'Programming Language :: JavaScript',
     ]
 
-__depends__ = {'cubicweb': '>= 3.19.0'}
+__depends__ = {'cubicweb': '>= 3.19.0',
+               'six': '>= 1.4.0',}
 __recommends__ = {'cubicweb-tag': None,
                   'cubicweb-preview': None,
                   'cubicweb-comment': '>= 1.6.3',
--- a/cubicweb-blog.spec	Wed Sep 16 11:08:21 2015 +0200
+++ b/cubicweb-blog.spec	Wed Oct 21 12:15:41 2015 +0200
@@ -21,6 +21,7 @@
 
 BuildRequires:  %{python} %{python}-setuptools
 Requires:       cubicweb >= 3.19.0
+Requires:       %{python}-six >= 1.4.0
 
 %description
 blogging component for the CubicWeb framework
--- a/debian/control	Wed Sep 16 11:08:21 2015 +0200
+++ b/debian/control	Wed Oct 21 12:15:41 2015 +0200
@@ -14,6 +14,7 @@
 Architecture: all
 Depends:
  cubicweb-common (>= 3.19.0),
+ python-six (>= 1.4.0),
  ${python:Depends},
  ${misc:Depends},
 Suggests:
--- a/views/entry.py	Wed Sep 16 11:08:21 2015 +0200
+++ b/views/entry.py	Wed Oct 21 12:15:41 2015 +0200
@@ -11,6 +11,8 @@
 from calendar import monthrange
 from datetime import datetime
 
+from six import PY2
+
 from logilab.mtconverter import xml_escape
 
 from cubicweb.schema import display_name
@@ -135,7 +137,8 @@
     __regid__ = 'blog'
     __select__ = is_instance('BlogEntry')
 
-    toolbar_components = primary.PrimaryView.content_navigation_components.im_func
+    toolbar_components = (primary.PrimaryView.content_navigation_components.im_func if PY2 else
+                          primary.PrimaryView.content_navigation_components)
 
     def cell_call(self, row, col, **kwargs):
         entity = self.cw_rset.get_entity(row, col)