Skip to content

Commit

Permalink
fixed a python3-specific bug in ttree.py causing expressions containi…
Browse files Browse the repository at this point in the history
…ng ".." (like "@atom:../A") to sometimes cause an uncaught exception
  • Loading branch information
jewettaij committed Aug 5, 2020
1 parent 75c683e commit 45904a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions moltemplate/scripts/moltemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Copyright (c) 2013

G_PROGRAM_NAME="moltemplate.sh"
G_VERSION="2.18.3"
G_DATE="2020-7-26"
G_VERSION="2.18.4"
G_DATE="2020-8-05"

echo "${G_PROGRAM_NAME} v${G_VERSION} ${G_DATE}" >&2
echo "" >&2
Expand Down
11 changes: 8 additions & 3 deletions moltemplate/ttree.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
g_module_name = g_filename
if g_filename.rfind('.py') != -1:
g_module_name = g_filename[:g_filename.rfind('.py')]
g_date_str = '2020-7-09'
g_version_str = '0.86.4'
g_date_str = '2020-8-05'
g_version_str = '0.86.5'


class ClassReference(object):
Expand Down Expand Up @@ -4317,7 +4317,12 @@ def AssignStaticVarPtrs(context_node, search_instance_commands=False):
AssignTemplateVarPtrs(command.tmpl_list, context_node)

# Recursively invoke AssignVarPtrs() on all (non-leaf) child nodes:
for child in context_node.children.values():
#old code:
# for child in context_node.children.values():
#new code (make copy before iterating since children are added during loop):
# for child in context_node.children.copy().values():
#this also works:
for child in list(context_node.children.values()):
AssignStaticVarPtrs(child, search_instance_commands)


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@

url='https://github.com/jewettaij/moltemplate',

download_url='https://github.com/jewettaij/moltemplate/archive/v2.18.3.zip',
download_url='https://github.com/jewettaij/moltemplate/archive/v2.18.4.zip',

version='2.18.3',
version='2.18.4',

keywords=['simulation', 'LAMMPS', 'molecule editor', 'molecule builder',
'ESPResSo'],
Expand Down

0 comments on commit 45904a0

Please sign in to comment.