diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 3684c6f1c92..2015c225b62 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -134,7 +134,7 @@ class AccountAccount(models.Model): if vals.get('company_id', False): move_lines = self.env['account.move.line'].search([('account_id', 'in', self.ids)], limit=1) for account in self: - if (account.company_id.id <> vals['company_id']) and move_lines: + if (account.company_id.id != vals['company_id']) and move_lines: raise UserError(_('You cannot change the owner company of an account that already contains journal items.')) # If user change the reconcile flag, all aml should be recomputed for that account and this is very costly. # So to prevent some bugs we add a constraint saying that you cannot change the reconcile field if there is any aml existing diff --git a/addons/mail/models/html2text.py b/addons/mail/models/html2text.py index c4c8fdb21fa..fb16b1fbda0 100755 --- a/addons/mail/models/html2text.py +++ b/addons/mail/models/html2text.py @@ -276,7 +276,7 @@ class _html2text(sgmllib.SGMLParser): a['count'] = self.acount a['outcount'] = self.outcount self.a.append(a) - self.o("][" + `a['count']` + "]") + self.o("][%r]" % a['count']) if tag == "img" and start: attrsD = {} @@ -295,7 +295,7 @@ class _html2text(sgmllib.SGMLParser): self.a.append(attrs) self.o("![") self.o(alt) - self.o("]["+`attrs['count']`+"]") + self.o("][%r]" % attrs['count']) if tag == 'dl' and start: self.p() if tag == 'dt' and not start: self.pbr() @@ -319,7 +319,7 @@ class _html2text(sgmllib.SGMLParser): if li['name'] == "ul": self.o("* ") elif li['name'] == "ol": li['num'] += 1 - self.o(`li['num']`+". ") + self.o("%r. " % li['num']) self.start = 1 else: self.pbr() @@ -389,7 +389,7 @@ class _html2text(sgmllib.SGMLParser): newa = [] for link in self.a: if self.outcount > link['outcount']: - self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href'])) + self.out(" ["+repr(link['count'])+"]: " + urlparse.urljoin(self.baseurl, link['href'])) if link.has_key('title'): self.out(" ("+link['title']+")") self.out("\n") else: diff --git a/addons/website_rating_project_issue/controllers/main.py b/addons/website_rating_project_issue/controllers/main.py index 0494bb7efc0..c819b7171c7 100644 --- a/addons/website_rating_project_issue/controllers/main.py +++ b/addons/website_rating_project_issue/controllers/main.py @@ -23,7 +23,7 @@ class WebsiteRatingProject(http.Controller): project = request.env['project.project'].sudo().browse(project_id) # to avoid giving any access rights on projects to the public user, let's use sudo # and check if the user should be able to view the project (project managers only if it's unpublished or has no rating) - if not ((project.rating_status<>'no') and project.website_published) and not user.sudo(user).has_group('project.group_project_manager'): + if not ((project.rating_status!='no') and project.website_published) and not user.sudo(user).has_group('project.group_project_manager'): raise NotFound() values = { 'project': project, diff --git a/doc/python3.rst b/doc/python3.rst index a0db3381a57..55047f16d4b 100644 --- a/doc/python3.rst +++ b/doc/python3.rst @@ -86,3 +86,15 @@ or:: This form was implemented in Python 2.5 and is thus compatible across the board. + +Removed Operators +----------------- + +.. important:: + + * The backtick operator ``\`foo\``` must be converted to an explicit call + to the ``repr()`` builtin + * The ``<>`` operator must be replaced by ``!=`` + +These two operators were long recommended against/deprecated in Python 2, +Python 3 removed them from the language.