Use pathlib instead of os.path

This commit is contained in:
Howard Wu 2022-09-17 21:15:44 +08:00
parent 08fbb8d9dc
commit 9968805324
7 changed files with 14 additions and 17 deletions

View file

@ -25,7 +25,6 @@ from xml.dom import minidom
import html
import warnings
import re
import os
from pathlib import Path
warnings.filterwarnings("ignore")
@ -81,8 +80,8 @@ for node in doc.getElementsByTagName('SecuredFragment'):
with open(Path.cwd().parent / "xml/FE3FileUrl.xml", "r") as f:
file_content = f.read()
if not os.path.exists(download_dir):
os.makedirs(download_dir)
if not download_dir.is_dir():
download_dir.mkdir()
tmpdownlist = open(download_dir/tempScript, 'a')
for i, v, f in identities:
if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", f):