mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Avoid extra roundtrip to filesystem
This commit is contained in:
parent
5799e93703
commit
7bfe9e3e1a
@ -126,7 +126,7 @@ def is_case_sensitive(path):
|
|||||||
name1, name2 = ('calibre_test_case_sensitivity.txt',
|
name1, name2 = ('calibre_test_case_sensitivity.txt',
|
||||||
'calibre_TesT_CaSe_sensitiVitY.Txt')
|
'calibre_TesT_CaSe_sensitiVitY.Txt')
|
||||||
f1, f2 = os.path.join(path, name1), os.path.join(path, name2)
|
f1, f2 = os.path.join(path, name1), os.path.join(path, name2)
|
||||||
if os.path.exists(f1):
|
with suppress(OSError):
|
||||||
os.remove(f1)
|
os.remove(f1)
|
||||||
open(f1, 'w').close()
|
open(f1, 'w').close()
|
||||||
is_case_sensitive = not os.path.exists(f2)
|
is_case_sensitive = not os.path.exists(f2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user