fix: importing packages with scripts that have "." in the script name (#35784)
* fix: importing packages with scripts that have "." in the script name * style: code formatting
This commit is contained in:
parent
7279b8e89d
commit
15602ce059
1 changed files with 1 additions and 1 deletions
|
|
@ -248,7 +248,7 @@ def load_code_properties(doc, path):
|
||||||
if hasattr(doc, "get_code_fields"):
|
if hasattr(doc, "get_code_fields"):
|
||||||
dirname, filename = os.path.split(path)
|
dirname, filename = os.path.split(path)
|
||||||
for key, extn in doc.get_code_fields().items():
|
for key, extn in doc.get_code_fields().items():
|
||||||
codefile = os.path.join(dirname, filename.split(".", 1)[0] + "." + extn)
|
codefile = os.path.join(dirname, filename[: filename.rfind(".")] + "." + extn)
|
||||||
if os.path.exists(codefile):
|
if os.path.exists(codefile):
|
||||||
with open(codefile) as txtfile:
|
with open(codefile) as txtfile:
|
||||||
doc.set(key, txtfile.read())
|
doc.set(key, txtfile.read())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue