Commit Graph
7 Commits
Author SHA1 Message Date
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +02:00
Xavier Morel 76852a2fad [#8530] fix uses of `reduce` builtin
Demoted to library in Python 3, see if uses can be replaced by more
specific construct, just import functools.reduce otherwise.

Futurize fixers:
* lib2to3.fixes.fix_reduce
2017-04-12 13:48:42 +02:00
Xavier Morel f1168d06c0 [#8530] fix octal literals (and remove unwittingly octals)
For readability and coherence, in Python 3 the prefix for octal
literal becomes ``0o`` (rather than just ``0``). This new version was
also added to Python 2 as of 2.6.

Convert all octal literals in file-manipulation code (POSIX ACL), and
fix a few integers which were unwittingly octal.

(lib2to3.fixes.fix_numliterals)
2017-04-11 17:29:18 +02:00
Xavier Morel 578b0ef2fd [#8530] convert dict.has_key
Redundant with `in` and removed from Python 3.

Removed odd, old and long-unused UpdatableDict (which defines and uses
has_key) and UpdatableStr (which was nearby and caught in the blast),
validated with al.

(lib2to3.fixes.fix_has_key)
2017-04-11 17:04:45 +02:00
Xavier Morel 3f20662b3e [#8530] convert deprecated operators
* `<>` was removed and should be replaced by
  `!=` (lib2to3.fixes.fix_ne)
* `\`` was removed and should be replaced by either `repr()` or the
  `%r` format string modifier (lib2to3.fixes.fix_repr followed by
  hand-rolled edition to replace concatenation)
2017-04-11 16:29:51 +02:00
Xavier Morel 3979f6802e [#8530] convert exception handlers to except..as syntax
Futurize fixers:
* lib2to3.fixes.fix_except
2017-04-11 14:53:29 +02:00