root / gr-howto-write-a-block-cmake / python / __init__.py @ 626018eb
History | View | Annotate | Download (1.7 kB)
| 1 | #
|
|---|---|
| 2 | # Copyright 2008,2009 Free Software Foundation, Inc.
|
| 3 | #
|
| 4 | # This application is free software; you can redistribute it and/or modify
|
| 5 | # it under the terms of the GNU General Public License as published by
|
| 6 | # the Free Software Foundation; either version 3, or (at your option)
|
| 7 | # any later version.
|
| 8 | #
|
| 9 | # This application is distributed in the hope that it will be useful,
|
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 12 | # GNU General Public License for more details.
|
| 13 | #
|
| 14 | # You should have received a copy of the GNU General Public License along
|
| 15 | # with this program; if not, write to the Free Software Foundation, Inc.,
|
| 16 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
| 17 | #
|
| 18 | |
| 19 | # The presence of this file turns this directory into a Python package
|
| 20 | |
| 21 | # ----------------------------------------------------------------
|
| 22 | # Temporary workaround for ticket:181 (swig+python problem)
|
| 23 | import sys |
| 24 | _RTLD_GLOBAL = 0
|
| 25 | try:
|
| 26 | from dl import RTLD_GLOBAL as _RTLD_GLOBAL |
| 27 | except ImportError: |
| 28 | try:
|
| 29 | from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL |
| 30 | except ImportError: |
| 31 | pass
|
| 32 | |
| 33 | if _RTLD_GLOBAL != 0: |
| 34 | _dlopenflags = sys.getdlopenflags() |
| 35 | sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) |
| 36 | # ----------------------------------------------------------------
|
| 37 | |
| 38 | |
| 39 | # import swig generated symbols into the howto namespace
|
| 40 | from howto_swig import * |
| 41 | |
| 42 | # import any pure python here
|
| 43 | #
|
| 44 | |
| 45 | # ----------------------------------------------------------------
|
| 46 | # Tail of workaround
|
| 47 | if _RTLD_GLOBAL != 0: |
| 48 | sys.setdlopenflags(_dlopenflags) # Restore original flags
|
| 49 | # ----------------------------------------------------------------
|