From 36368b6db94e13f5e60c8e94a8fb233ae2336f44 Mon Sep 17 00:00:00 2001 From: Gustavo Carneiro Date: Thu, 13 Mar 2014 07:53:32 -0700 Subject: [PATCH] fixes for Python 2.6 compatibility --- bindings/python/ns3modulegen_core_customizations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/ns3modulegen_core_customizations.py b/bindings/python/ns3modulegen_core_customizations.py index 19c2d5114..0b3ea83c3 100644 --- a/bindings/python/ns3modulegen_core_customizations.py +++ b/bindings/python/ns3modulegen_core_customizations.py @@ -28,13 +28,13 @@ class SmartPointerTransformation(typehandlers.TypeTransformation): def __init__(self): super(SmartPointerTransformation, self).__init__() self.rx = re.compile(r'(ns3::|::ns3::|)Ptr<([^>]+)>\s*$') - print("{!r}".format(self), file=sys.stderr) + print("{0!r}".format(self), file=sys.stderr) def _get_untransformed_type_traits(self, name): m = self.rx.match(name) is_const = False if m is None: - print("{!r} did not match".format(name), file=sys.stderr) + print("{0!r} did not match".format(name), file=sys.stderr) return None, False else: name1 = m.group(2).strip() @@ -65,9 +65,9 @@ class SmartPointerTransformation(typehandlers.TypeTransformation): ## fix the ctype, add ns3:: namespace orig_ctype, is_const = self._get_untransformed_type_traits(args[0]) if is_const: - correct_ctype = 'ns3::Ptr< {} const >'.format(orig_ctype[:-2]) + correct_ctype = 'ns3::Ptr< {0} const >'.format(orig_ctype[:-2]) else: - correct_ctype = 'ns3::Ptr< {} >'.format(orig_ctype[:-2]) + correct_ctype = 'ns3::Ptr< {0} >'.format(orig_ctype[:-2]) args = tuple([correct_ctype] + list(args[1:])) handler = type_handler(*args, **kwargs)