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

@ -20,8 +20,8 @@
from __future__ import annotations
from io import TextIOWrapper
from os import system, path
from typing import OrderedDict
from pathlib import Path
import sys
class Prop(OrderedDict):
def __init__(self, file: TextIOWrapper) -> None:
@ -61,7 +61,7 @@ def fingerprint(sec: str, p: Prop) -> str:
def fix_prop(sec, prop):
if not path.exists(prop):
if not Path(prop).is_file():
return
print(f"fixing {prop}", flush=True)