# HG changeset patch # User Gustavo Carneiro # Date 1394722412 25200 # Node ID 0865638cacc91c25133c4feea9544c2b09f1bea7 # Parent 0ae847ef07a9533338fd2fe208a94026b7785262 fixes for Python 2.6 compatibility diff -r 0ae847ef07a9 -r 0865638cacc9 bindings/python/ns3modulegen_core_customizations.py --- a/bindings/python/ns3modulegen_core_customizations.py Thu Mar 13 06:37:41 2014 -0700 +++ b/bindings/python/ns3modulegen_core_customizations.py Thu Mar 13 07:53:32 2014 -0700 @@ -28,13 +28,13 @@ 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 @@ ## 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)