Reviewed-by: Michael D Kinney <michael.d.kin...@intel.com> > -----Original Message----- > From: Joey Vagedes <joey.vage...@gmail.com> > Sent: Monday, January 22, 2024 3:21 PM > To: devel@edk2.groups.io > Cc: Liming Gao <gaolim...@byosoft.com.cn>; Kinney, Michael D > <michael.d.kin...@intel.com>; Sean Brogan <sean.bro...@microsoft.com> > Subject: [PATCH v1 1/1] .pytool/Plugin: UncrustifyCheck: use stat > instead of os.stat > > The UncrustifyCheck plugin passes os.stat.S_IWRITE to os.chmod, when > attempting to change file permissions. os.stat.S_IWRITE does not exist > as os.stat is a function. The correct value is stat.S_IWRITE. > > Signed-off-by: Joey Vagedes <joey.vage...@gmail.com> > Cc: Liming Gao <gaolim...@byosoft.com.cn> > Cc: Michael D Kinney <michael.d.kin...@intel.com> > Cc: Sean Brogan <sean.bro...@microsoft.com> > --- > .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > index 9aeef5a5a3..73dc03c0dc 100644 > --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > @@ -12,6 +12,7 @@ import logging > import os > > import pathlib > > import shutil > > +import stat > > import timeit > > from edk2toolext.environment import version_aggregator > > from edk2toolext.environment.plugin_manager import PluginManager > > @@ -628,7 +629,7 @@ class UncrustifyCheck(ICiBuildPlugin): > """ > > Private function to attempt to change permissions on > file/folder being deleted. > > """ > > - os.chmod(path, os.stat.S_IWRITE) > > + os.chmod(path, stat.S_IWRITE) > > func(path) > > > > for _ in range(3): # retry up to 3 times > > -- > 2.40.1.vfs.0.0
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114154): https://edk2.groups.io/g/devel/message/114154 Mute This Topic: https://groups.io/mt/103898982/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-