Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75727 - trunk/tools/build/v2/engine
From: ghost_at_[hidden]
Date: 2011-11-29 11:11:56


Author: vladimir_prus
Date: 2011-11-29 11:11:54 EST (Tue, 29 Nov 2011)
New Revision: 75727
URL: http://svn.boost.org/trac/boost/changeset/75727

Log:
Make bjam.caller return module name without trailing dot.

This makes the behaviour consistent with Jam's builtin for the same
purpose and fixes make_rule.py test.

Text files modified:
   trunk/tools/build/v2/engine/builtins.c | 7 +++++--
   1 files changed, 5 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/engine/builtins.c
==============================================================================
--- trunk/tools/build/v2/engine/builtins.c (original)
+++ trunk/tools/build/v2/engine/builtins.c 2011-11-29 11:11:54 EST (Tue, 29 Nov 2011)
@@ -2181,8 +2181,11 @@
 
 PyObject * bjam_caller( PyObject * self, PyObject * args )
 {
- return PyString_FromString(
- object_str( frame_before_python_call->prev->module->name ) );
+ /* Module names in Jam end in dot. The CALLER builtin in jam
+ language strips the dot, and we do the same here to make it
+ easier to port Jam code to Python. */
+ const char *s = object_str( frame_before_python_call->prev->module->name );
+ return PyString_FromStringAndSize(s, strlen(s)-1);
 }
 
 #endif /* #ifdef HAVE_PYTHON */


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk