summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Vagedes <joey.vagedes@gmail.com>2024-01-22 14:41:15 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-01-23 16:04:20 +0000
commitd97f3a1d80fc4880da9726d9a5d7504d3c31da70 (patch)
treea70a9c5f211ccdc01f5d7466bf7d6143a6ef0f2c
parent313f9f01552227138e08a7a7f44be48e5ba20a99 (diff)
downloadedk2-d97f3a1d80fc4880da9726d9a5d7504d3c31da70.tar.gz
edk2-d97f3a1d80fc4880da9726d9a5d7504d3c31da70.tar.bz2
edk2-d97f3a1d80fc4880da9726d9a5d7504d3c31da70.zip
.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.vagedes@gmail.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
-rw-r--r--.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py3
1 files changed, 2 insertions, 1 deletions
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