Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • pygolang pygolang
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedinexedi
  • pygolangpygolang
  • Merge requests
  • !8

Don't inherit __future__ when executing scripts

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Jérome Perrin requested to merge jerome/pygolang:fix/execfile_futures into master Nov 26, 2020
  • Overview 8
  • Commits 1
  • Changes 4

Because we use execfile to emulate "python script.py" invocation, future enabled in gpython main script are also enabled in "script.py" and because we use print_function feature, it was also applied in "script.py". On python 2 when "script.py" uses print statements they were considered as SyntaxError.

Hopefuly, compile has a dont_inherit flag which does exactly what we need here: compile the script without inheriting futures enabled, so we use compile with this flag.

Edited Nov 26, 2020 by Jérome Perrin
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/execfile_futures
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7