Only compute shasum of file if it exists (#1023)
This commit is contained in:
committed by
GitHub
parent
16ce55ba60
commit
8c4e5b99fe
@@ -89,9 +89,10 @@ class NWDoc():
|
|||||||
|
|
||||||
theText = ""
|
theText = ""
|
||||||
self._docMeta = {}
|
self._docMeta = {}
|
||||||
self._prevHash = sha256sum(docPath)
|
self._prevHash = None
|
||||||
|
|
||||||
if os.path.isfile(docPath):
|
if os.path.isfile(docPath):
|
||||||
|
self._prevHash = sha256sum(docPath)
|
||||||
try:
|
try:
|
||||||
with open(docPath, mode="r", encoding="utf-8") as inFile:
|
with open(docPath, mode="r", encoding="utf-8") as inFile:
|
||||||
# Check the first <= 10 lines for metadata
|
# Check the first <= 10 lines for metadata
|
||||||
|
|||||||
Reference in New Issue
Block a user