Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !1634

Merged
Created May 24, 2022 by Jérome Perrin@jeromeOwner

*: keep using func_code and not yet __code__ with scripts

  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 7

On Zope2, python scripts do not have __code__, they only have func_code (and same for __defauls__/func_defaults). We tried to backport the support of __code__ from Zope4 as a Zope2 patch - it was SlapOS patch slapos@4fa33dfc - but this patch was incomplete. We tried to backport more, but then realized that we don't need to use __code__ on ERP5 master yet, because ERP5 master branch is still supporting Zope2 only.

This patch revert a small part of a17bb910 (py2/py3: Make Products code compatible with both python2 and python3., 2022-04-13), the part where we use f.__code__ where f might be a python script. For now, we'll apply this patch only on the Zope4 branch.

A few places where f.__code__ was used and f was a for sure not a python script but a simple class method or function are kept here, as __code__ support is missing only on in ZODB scripts.

Edited May 24, 2022 by Jérome Perrin
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/revert__code__to_func_code
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7