Skip to content

Commit 3ad8dfe

Browse files
committed
Hotfix to v0.2.3
Command line window was fliashing while using program, due to incorrect checking ~/AppData/Local folder. Stability and performance enhanced.
1 parent f425ebd commit 3ad8dfe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python_password/utils/files.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
from os import getenv, path, sep, system
2+
from os import getenv, path, sep, mkdir
33

44

55
class Files:
@@ -11,7 +11,10 @@ class Files:
1111

1212
def generate_appdata():
1313
"""Creates ``PyPassword`` ~/AppData/Local/PyPassword directory if not exists."""
14-
system('cd %localappdata% && if not exists "PyPassword" @md "PyPassword"')
14+
try:
15+
mkdir(f'{getenv("LOCALAPPDATA")}{sep}PyPassword')
16+
except FileExistsError:
17+
pass
1518

1619

1720
def appdata(filename: str):

0 commit comments

Comments
 (0)