simplify path construction with os.path.join

This commit is contained in:
Eli Schwartz 2019-08-08 23:16:43 -04:00
parent af81778588
commit f7aa4cda79
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -136,7 +136,7 @@ def get_default_library_path():
fname.encode(filesystem_encoding) fname.encode(filesystem_encoding)
except Exception: except Exception:
fname = 'Calibre Library' fname = 'Calibre Library'
x = os.path.expanduser('~'+os.sep+fname) x = os.path.expanduser(os.path.join('~', fname))
if not os.path.exists(x): if not os.path.exists(x):
try: try:
os.makedirs(x) os.makedirs(x)