[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] swig-py: restrict *-import to svn_* names

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Sun, 18 Mar 2012 02:07:45 +0200

[[[
Index: subversion/bindings/swig/python/svn/fs.py
===================================================================
--- subversion/bindings/swig/python/svn/fs.py (revision 1301511)
+++ subversion/bindings/swig/python/svn/fs.py (working copy)
@@ -27,6 +27,7 @@ from libsvn.fs import *
 from svn.core import _unprefix_names, Pool
 _unprefix_names(locals(), 'svn_fs_')
 _unprefix_names(locals(), 'SVN_FS_')
+__all__ = filter(lambda x: x.lower().startswith('svn_'), locals().keys())
 del _unprefix_names
]]]

Before:
    % python -c 'from svn.fs import *;
                 print [x for x in locals().keys() if "begin_txn2" in x]'
    ['svn_fs_begin_txn2', 'begin_txn2']

After:
    % python -c 'from svn.fs import *;
                 print [x for x in locals().keys() if "begin_txn2" in x]'
    ['svn_fs_begin_txn2']
Received on 2012-03-18 01:08:31 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.