8000 update path · bonfy/leetcode@d2c1ccd · GitHub
[go: up one dir, main page]

Skip to content

Commit d2c1ccd

Browse files
committed
update path
1 parent 1af3eb1 commit d2c1ccd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

leetcode_generate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def rep_unicode_in_code(code):
8888

8989

9090
def check_and_make_dir(dirname):
91-
if not Path.exists(dirname):
92-
Path.mkdir(dirname, parents=true)
91+
p = Path(dirname)
92+
if not p.exists():
93+
p.make_dir(parents=true)
9394

9495

9596
ProgLang = namedtuple('ProgLang', ['language', 'ext', 'annotation'])
@@ -295,7 +296,7 @@ def _generate_items_from_api(self, json_data):
295296
def is_login(self):
296297
""" validate if the cookie exists and not overtime """
297298
api_url = self.base_url + '/api/problems/algorithms/' # NOQA
298-
if not Path.exists(COOKIE_PATH):
299+
if not COOKIE_PATH.exists():
299300
return False
300301

301302
with open(COOKIE_PATH, 'r') as f:

0 commit comments

Comments
 (0)
0