Skip to content

Commit 0e3e588

Browse files
authored
Merge pull request #6842 from ivanimanishi/deprecationFixes
Replace deprecated distutils with modern alternatives
2 parents 754c129 + 98c0a6a commit 0e3e588

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
1.6.x.x (relative to 1.6.14.0)
22
=======
33

4+
Fixes
5+
-----
6+
7+
- SConstruct, ShowURL, ArnoldtextureBake : Replaced deprecated distutils with modern alternatives.
48

59

610
1.6.14.0 (relative to 1.6.13.0)

SConstruct

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import locale
4646
import shutil
4747
import subprocess
4848
import tempfile
49-
import distutils.dir_util
5049
import codecs
5150

5251
EnsureSConsVersion( 3, 0, 2 ) # Substfile is a default builder as of 3.0.2
@@ -2438,7 +2437,7 @@ for f in exampleFiles :
24382437

24392438
def installer( target, source, env ) :
24402439

2441-
distutils.dir_util.copy_tree( str( source[0] ), str( target[0] ), preserve_symlinks=True, update=True )
2440+
shutil.copytree( str( source[0] ), str( target[0] ), symlinks=True, dirs_exist_ok=True )
24422441

24432442
if env.subst( "$PACKAGE_FILE" ).endswith( ".dmg" ) :
24442443

python/GafferArnold/ArnoldTextureBake.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,9 @@ def __init__( self, name = "ArnoldTextureBake" ) :
405405
self["__outputIndexCommand"]["command"].setValue( inspect.cleandoc(
406406
"""
407407
import os
408-
import distutils.dir_util
409408
410409
# Ensure path exists
411-
distutils.dir_util.mkpath( variables["bakeDirectory"] )
410+
os.makedirs( variables["bakeDirectory"], exist_ok = True )
412411
413412
f = open( variables["indexFilePath"], "w", encoding = "utf-8" )
414413

python/GafferUI/ShowURL.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@
3636
##########################################################################
3737

3838
import os
39+
import shutil
3940
import sys
40-
import distutils.spawn
41-
42-
import GafferUI
4341

4442
from Qt import QtCore
4543
from Qt import QtGui
@@ -50,7 +48,7 @@ def showURL( url ) :
5048
if sys.platform == "darwin" :
5149
opener = "open"
5250
elif "linux" in sys.platform :
53-
opener = distutils.spawn.find_executable( "xdg-open" )
51+
opener = shutil.which( "xdg-open" )
5452

5553
if opener :
5654
os.system( "{0} \"{1}\"".format( opener, url ) )

0 commit comments

Comments
 (0)