From f61a821de967cb3643506fd8873406f697e60583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Gl=C3=A4=C3=9Fle?= Date: Sun, 4 May 2014 14:31:28 +0200 Subject: [PATCH] Fix some python3 problems --- madseq.py | 2 +- test/test_element.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/madseq.py b/madseq.py index 5374975..239d6d9 100755 --- a/madseq.py +++ b/madseq.py @@ -581,7 +581,7 @@ def __call__(self, node, defs): """ if isinstance(node, Element): - defs[node.name] = node + defs[str(node.name)] = node node._base = defs.get(node.type) if not isinstance(node, Sequence): return node diff --git a/test/test_element.py b/test/test_element.py index c6bf677..fbbbfef 100644 --- a/test/test_element.py +++ b/test/test_element.py @@ -1,7 +1,7 @@ # test utilities import unittest -from pydicti import odicti +from pydicti import odicti, dicti # tested module import madseq @@ -38,8 +38,8 @@ def test_all_args(self): el1 = madseq.Element(None, None, odicti(a='a1', b='b1', d='d1'), el0) el2 = madseq.Element(None, None, odicti(a='a2'), el1) self.assertEqual(el2.all_args, - odicti([('c', 'c0'), ('b', 'b1'), - ('d', 'd1'), ('a', 'a2')])) + dicti([('c', 'c0'), ('b', 'b1'), + ('d', 'd1'), ('a', 'a2')])) def test_copy(self): el = madseq.Element(None, None, odicti(a=1))