Skip to content

Commit

Permalink
doc: clarify python initialization example
Browse files Browse the repository at this point in the history
Update Python initialization example to precise that the init script
should be exec-ed in the global scope. This is important when init
script is executed from a function.

This change helps to clarify a question asked on #483.
  • Loading branch information
xdelaruelle committed Apr 4, 2023
1 parent 2835f6b commit d9f2db1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/source/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Python:
.. parsed-literal::
import os
exec(open('\ |initdir|\ /python.py').read())
module('load', 'modulefile', 'modulefile', '...')
exec(open("\ |initdir|\ /python.py").read(), globals())
module("load", "modulefile", "modulefile", "...")
Bourne Shell (sh) (and derivatives) with :subcmd:`autoinit` sub-command:

Expand Down

0 comments on commit d9f2db1

Please sign in to comment.