commit e69e0f84e3698700d2702654e89e42528bd140a6
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Aug 26 15:48:52 2026 +0200
Amend d3ec2b53953
---
lib/lyx2lyx/parser_tools.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py
index 8fd5616ec7..147df63426 100644
--- a/lib/lyx2lyx/parser_tools.py
+++ b/lib/lyx2lyx/parser_tools.py
@@ -289,10 +289,11 @@ def has_token(lines, token, directory=""):
fn = get_quoted_value(lines, "filename", i, j)
if directory:
fn = os.path.join(directory, fn)
- with open(fn) as f:
- for line in f:
- if line.startswith(token):
- return True
+ if fn.endswith(".lyx") and os.path.isfile(fn):
+ with open(fn) as f:
+ for line in f:
+ if line.startswith(token):
+ return True
i += 1
return False
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs