Skip to content

Commit 4d0fbcb

Browse files
author
earthmant
committed
Py3
1 parent 785409c commit 4d0fbcb

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

cloudify_importer/loader.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
import sys
16-
import imp
15+
1716
import os
18-
import __builtin__
17+
import imp
18+
import sys
19+
20+
PY2 = sys.version_info[0] == 2
21+
22+
if PY2:
23+
import __builtin__ as builtins
24+
else:
25+
import builtins
1926

2027

2128
class _OurImporter(object):
@@ -86,7 +93,7 @@ def _check_import(dir_name):
8693
def register_callback():
8794
sys.path_hooks.append(_check_import)
8895

89-
save_import = __builtin__.__import__
96+
save_import = builtins.__import__
9097

9198
def new_import(*argv, **kwargs):
9299
try:
@@ -104,4 +111,4 @@ def new_import(*argv, **kwargs):
104111

105112
return module
106113

107-
__builtin__.__import__ = new_import
114+
builtins.__import__ = new_import

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
setup(
2020
name='cloudify-python-importer',
21-
version='0.1',
21+
version='0.2',
2222
author='Cloudify Team',
2323
author_email='[email protected]',
2424
description='Plugin provides Kubernetes management possibility',

0 commit comments

Comments
 (0)