summaryrefslogtreecommitdiff
path: root/grc/core/FlowGraph.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/core/FlowGraph.py')
-rw-r--r--grc/core/FlowGraph.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py
index 138ae44ee5..72d0594081 100644
--- a/grc/core/FlowGraph.py
+++ b/grc/core/FlowGraph.py
@@ -20,6 +20,7 @@ from __future__ import absolute_import, print_function
import collections
import itertools
import sys
+import types
from operator import methodcaller, attrgetter
from . import Messages, blocks
@@ -29,16 +30,6 @@ from .utils import expr_utils
from .utils.backports import shlex
-if sys.version_info[0] < 3:
- import imp
- def _new_module_helper(name):
- return imp.new_module(name)
-else:
- import types
- def _new_module_helper(name):
- return types.ModuleType(name)
-
-
class FlowGraph(Element):
is_flow_graph = True
@@ -201,7 +192,7 @@ class FlowGraph(Element):
for id, expr in self.get_python_modules():
try:
- module = _new_module_helper(id)
+ module = types.ModuleType(id)
exec(expr, module.__dict__)
namespace[id] = module
except: