Skip to content

Commit

Permalink
v.class.ml: fix compile module on OS MS Windows platform (#314)
Browse files Browse the repository at this point in the history
* v.class.ml: fix single quotes in the 'svc_kernel' parameter description

* v.class.ml: replace deprecated 'imp.load_source()' method with 'importlib.machinery.SourceFileLoader()'
  • Loading branch information
tmszi committed Oct 15, 2020
1 parent 3708030 commit 771b4bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grass7/vector/v.class.ml/v.class.ml.py
Expand Up @@ -290,7 +290,7 @@
#% key: svc_kernel
#% type: string
#% multiple: no
#% description: definitive kernel value. Available kernel are: linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed
#% description: definitive kernel value. Available kernel are: 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'
#% required: no
#% answer: rbf
#%end
Expand Down Expand Up @@ -362,7 +362,7 @@
#-----------------------------------------------------
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import imp
from importlib.machinery import SourceFileLoader
import sys
import os
from pprint import pprint
Expand Down Expand Up @@ -539,7 +539,7 @@ def main(opt, flg):
# define the classifiers to use/test
if opt['pyclassifiers'] and opt['pyvar']:
# import classifiers to use
mycls = imp.load_source("mycls", opt['pyclassifiers'])
mycls = SourceFileLoader("mycls", opt['pyclassifiers']).load_module()
classifiers = getattr(mycls, opt['pyvar'])
else:
from ml_classifiers import CLASSIFIERS
Expand Down

0 comments on commit 771b4bd

Please sign in to comment.