changeset 7cf1e8656473 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=7cf1e8656473
description:
        Replace __unicode__ by __str__

        The unicode method is no supported by Python3. There is only __str__.

        issue8769
        review262341002
diffstat:

 trytond/exceptions.py    |  8 ++++----
 trytond/model/model.py   |  3 ---
 trytond/report/report.py |  2 --
 3 files changed, 4 insertions(+), 9 deletions(-)

diffs (62 lines):

diff -r ac4d56e51695 -r 7cf1e8656473 trytond/exceptions.py
--- a/trytond/exceptions.py     Wed Oct 30 13:26:38 2019 +0100
+++ b/trytond/exceptions.py     Wed Oct 30 14:09:20 2019 +0100
@@ -15,7 +15,7 @@
         self.domain = domain
         self.code = 1
 
-    def __unicode__(self):
+    def __str__(self):
         return '%s - %s' % (self.message, self.description)
 
 
@@ -30,7 +30,7 @@
         self.description = description
         self.code = 2
 
-    def __unicode__(self):
+    def __str__(self):
         return '%s - %s' % (self.message, self.description)
 
 
@@ -56,7 +56,7 @@
         self.message = message
         self.code = 4
 
-    def __unicode__(self):
+    def __str__(self):
         return self.message
 
 
@@ -69,5 +69,5 @@
     def __init__(self, missings):
         self.missings = missings
 
-    def __unicode__(self):
+    def __str__(self):
         return 'Missing dependencies: %s' % ' '.join(self.missings)
diff -r ac4d56e51695 -r 7cf1e8656473 trytond/model/model.py
--- a/trytond/model/model.py    Wed Oct 30 13:26:38 2019 +0100
+++ b/trytond/model/model.py    Wed Oct 30 14:09:20 2019 +0100
@@ -288,9 +288,6 @@
     def __str__(self):
         return '%s,%s' % (self.__name__, self.id)
 
-    def __unicode__(self):
-        return '%s,%s' % (self.__name__, self.id)
-
     def __repr__(self):
         if self.id is None or self.id < 0:
             return "Pool().get('%s')(**%s)" % (self.__name__,
diff -r ac4d56e51695 -r 7cf1e8656473 trytond/report/report.py
--- a/trytond/report/report.py  Wed Oct 30 13:26:38 2019 +0100
+++ b/trytond/report/report.py  Wed Oct 30 14:09:20 2019 +0100
@@ -242,8 +242,6 @@
             def __str__(self):
                 return '%s,%s' % (Model.__name__, self.id)
 
-            def __unicode__(self):
-                return '%s,%s' % (Model.__name__, self.id)
         return [TranslateModel(id) for id in ids]
 
     @classmethod

Reply via email to