From 61d3b18704f8dd85489048b67c8c5e92b955f96e Mon Sep 17 00:00:00 2001 From: Andre Sailer <andre.philippe.sailer@cern.ch> Date: Fri, 20 Nov 2020 13:23:26 +0100 Subject: [PATCH] DDSim.Gun: fix exception in error, as val is a list string replacement complained --- DDG4/python/DDSim/Helper/Gun.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DDG4/python/DDSim/Helper/Gun.py b/DDG4/python/DDSim/Helper/Gun.py index c5f7765ff..0788c57a8 100644 --- a/DDG4/python/DDSim/Helper/Gun.py +++ b/DDG4/python/DDSim/Helper/Gun.py @@ -93,7 +93,7 @@ class Gun(ConfigHelper): self._direction = ConfigHelper.makeTuple(val) if len(self._direction) != 3: raise RuntimeError( - " gun.direction: malformed input '%s', needs to be a string representing a three vector " % val) + " gun.direction: malformed input '%s', needs to be a string representing a three vector " % (val,)) @property def position(self): @@ -105,7 +105,8 @@ class Gun(ConfigHelper): """check that the position is a three vector and can be parsed by ddg4""" self._position = ConfigHelper.makeTuple(val) if len(self._position) != 3: - raise RuntimeError(" gun.position: malformed input '%s', needs to be a string representing a three vector " % val) + raise RuntimeError( + " gun.position: malformed input '%s', needs to be a string representing a three vector " % (val,)) def setOptions(self, ddg4Gun): """set the starting properties of the DDG4 particle gun""" -- GitLab