Skip to content

Commit

Permalink
TestCase : Only chmod existing temp directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Jan 9, 2025
1 parent 8e26e30 commit 49ecfd8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/GafferTest/TestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def tearDown( self ) :
## \todo Fix Cortex so that wrapped classes don't require garbage collection.
IECore.RefCounted.collectGarbage()

for root, dirs, files in os.walk( self.temporaryDirectory() ) :
for fileName in [ p for p in files + dirs if not ( pathlib.Path( root ) / p ).is_symlink() ] :
( pathlib.Path( root ) / fileName ).chmod( stat.S_IRWXU )

if self.__temporaryDirectory is not None :
for root, dirs, files in os.walk( self.temporaryDirectory() ) :
for fileName in [ p for p in files + dirs if not ( pathlib.Path( root ) / p ).is_symlink() ] :
( pathlib.Path( root ) / fileName ).chmod( stat.S_IRWXU )

shutil.rmtree( self.__temporaryDirectory )

IECore.MessageHandler.setDefaultHandler( self.__defaultMessageHandler )
Expand Down

0 comments on commit 49ecfd8

Please sign in to comment.