mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Fix python warning (deprecated imp module)
This commit is contained in:
parent
bdd15644d3
commit
96268d6691
@ -1,8 +1,10 @@
|
|||||||
import imp, threading, sys
|
import importlib.util, threading, sys, os
|
||||||
|
|
||||||
def _py_handler(f):
|
def _py_handler(f):
|
||||||
with open(f) as pyfile:
|
spec = importlib.util.spec_from_file_location(os.path.basename(f), os.path.abspath(f))
|
||||||
imp.load_module('__main__', pyfile, f, (".py", "r", imp.PY_SOURCE))
|
module = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(module)
|
||||||
|
return module
|
||||||
|
|
||||||
def _geo_handler(f):
|
def _geo_handler(f):
|
||||||
from netgen.csg import CSGeometry
|
from netgen.csg import CSGeometry
|
||||||
|
Loading…
Reference in New Issue
Block a user