From: Paulo H. J. A. <pau...@gm...> - 2009-07-13 13:09:14
|
Hi, Worked with swig-1.3.39 Thank you. Paulo Amorim 2009/7/13 Richard Boulton <ri...@le...> > 2009/7/13 David Beazley <da...@da...>: > > I surely hope that the Python code fragment shown is not being > > generated by Swig (if so, can one of the Swig developers jump in and > > say why it's there?). > > Haoyu will be able to give more detail, but this was added in the > course of adding support for python 3. The relevant code comment in > python.cxx is: > > /* Import the C-extension module. This should be a relative import, > * since the shadow module may also have been imported by a relative > * import, and there is thus no guarantee that the C-extension is on > * sys.path. Relative imports must be explicitly specified from 2.6.0 > * onwards (implicit relative imports will raise a DeprecationWarning > * in 2.6, and fail in 2.7 onwards), but the relative import syntax > * isn't available in python 2.4 or earlier, so we have to write some > * code conditional on the python version. > */ > > > The bug is being caused because the finally: clause is making use of a > > variable that may or may not be assigned. For example, if an > > exception occurs in the first statement of the try: block, then fp > > won't be properly assigned. > > The bug was fixed in SVN in revision 11141. > > -- > Richard > |