Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pygolang pygolang
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedi
  • pygolangpygolang
  • Merge requests
  • !8

Closed
Created Nov 26, 2020 by Jérome Perrin@jeromeOwner
  • Report abuse
Report abuse

Don't inherit __future__ when executing scripts

  • Overview 8
  • Commits 1
  • Pipelines 2
  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/execfile_futures
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7