[Bf-blender-cvs] [41e267b] master: API Docs: use importlib in examples

Campbell Barton noreply at git.blender.org
Thu Nov 5 09:17:20 CET 2015


Commit: 41e267b4b46ea49a7f9ae7d92fa273813f00e324
Author: Campbell Barton
Date:   Thu Nov 5 19:08:17 2015 +1100
Branches: master
https://developer.blender.org/rB41e267b4b46ea49a7f9ae7d92fa273813f00e324

API Docs: use importlib in examples

===================================================================

M	doc/python_api/rst/info_tips_and_tricks.rst

===================================================================

diff --git a/doc/python_api/rst/info_tips_and_tricks.rst b/doc/python_api/rst/info_tips_and_tricks.rst
index 28d129b..8262526 100644
--- a/doc/python_api/rst/info_tips_and_tricks.rst
+++ b/doc/python_api/rst/info_tips_and_tricks.rst
@@ -114,9 +114,9 @@ This example shows loading a script in as a module and executing a module functi
 .. code-block:: python
 
    import myscript
-   import imp
+   import importlib
 
-   imp.reload(myscript)
+   importlib.reload(myscript)
    myscript.main()
 
 
@@ -143,8 +143,8 @@ this example adds the current blend files directory to the search path, then loa
       sys.path.append(blend_dir)
 
    import myscript
-   import imp
-   imp.reload(myscript)
+   import importlib
+   importlib.reload(myscript)
    myscript.main()
 
 
@@ -307,7 +307,7 @@ Since it's possible to access data which has been removed (see Gotcha's),
 this can be hard to track down the cause of crashes.
 
 To raise Python exceptions on accessing freed data (rather than crashing),
-enable the CMake build option WITH_PYTHON_SAFETY.
+enable the CMake build option ``WITH_PYTHON_SAFETY``.
 
 This enables data tracking which makes data access about 2x slower
 which is why the option isn't enabled in release builds.




More information about the Bf-blender-cvs mailing list