diff options
author | Cole <crobinso@redhat.com> | 2021-07-24 04:02:27 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-08-02 03:09:59 +0000 |
commit | 0b1b0a9674e27c858f05436ed92250f4498245cf (patch) | |
tree | 62352c439bc42669ceab7c0b692383df4a162f02 /BaseTools/Source/Python/AutoGen | |
parent | 2e1fb41339034a7b71a3c7fa097a1ff785dfe981 (diff) | |
download | edk2-0b1b0a9674e27c858f05436ed92250f4498245cf.tar.gz edk2-0b1b0a9674e27c858f05436ed92250f4498245cf.tar.bz2 edk2-0b1b0a9674e27c858f05436ed92250f4498245cf.zip |
python: Replace distutils.utils.split_quotes with shlex.split
distutils is deprecated and may be removed in python 3.12.
Use shlex.split which has been around since python 2.3.
shlex.split does not split on all the ASCII control characters that
split_quoted will[1], but for edk2 usage I don't think that matters.
[1] https://stackoverflow.com/questions/54999301/what-is-the-difference-between-distutils-util-split-quoted-and-shlex-split
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/UniClassObject.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index 883c2356e0..b16330e368 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -12,7 +12,7 @@ #
from __future__ import print_function
import Common.LongFilePathOs as os, codecs, re
-import distutils.util
+import shlex
import Common.EdkLogger as EdkLogger
from io import BytesIO
from Common.BuildToolError import *
@@ -233,7 +233,7 @@ class UniFileClassObject(object): # Get Language definition
#
def GetLangDef(self, File, Line):
- Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
+ Lang = shlex.split(Line.split(u"//")[0])
if len(Lang) != 3:
try:
FileIn = UniFileClassObject.OpenUniFile(LongFilePath(File.Path))
|