[Bf-blender-cvs] [3a05135e124] master: Cleanup: defer 'os' imports in startup scripts

Campbell Barton noreply at git.blender.org
Mon Apr 12 05:37:48 CEST 2021


Commit: 3a05135e12415c202e3fe7d69f3722c3711a3701
Author: Campbell Barton
Date:   Mon Apr 12 13:36:55 2021 +1000
Branches: master
https://developer.blender.org/rB3a05135e12415c202e3fe7d69f3722c3711a3701

Cleanup: defer 'os' imports in startup scripts

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

M	release/scripts/startup/bl_operators/clip.py
M	release/scripts/startup/bl_operators/screen_play_rendered_anim.py

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

diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index 73391f94c85..0470f542c63 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -18,7 +18,6 @@
 
 # <pep8 compliant>
 import bpy
-import os
 from bpy.types import Operator
 from bpy.props import FloatProperty
 from mathutils import (
@@ -356,6 +355,7 @@ class CLIP_OT_delete_proxy(Operator):
 
     @staticmethod
     def _rmproxy(abspath):
+        import os
         import shutil
 
         if not os.path.exists(abspath):
@@ -367,6 +367,7 @@ class CLIP_OT_delete_proxy(Operator):
             os.remove(abspath)
 
     def execute(self, context):
+        import os
         sc = context.space_data
         clip = sc.clip
         if clip.use_proxy_custom_directory:
diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 6c29c07c62e..0946e89a647 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -22,7 +22,6 @@
 
 import bpy
 from bpy.types import Operator
-import os
 
 from bpy.app.translations import pgettext_tip as tip_
 
@@ -62,6 +61,7 @@ class PlayRenderedAnim(Operator):
     bl_options = {'REGISTER'}
 
     def execute(self, context):
+        import os
         import subprocess
         from shlex import quote



More information about the Bf-blender-cvs mailing list