Commit 72301b2 1 parent b999417 commit 72301b2 Copy full SHA for 72301b2
File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import importlib .util
2
2
import os
3
3
import traceback
4
+ import uuid
4
5
5
6
import click
6
7
8
+ from ..console import commands
7
9
from ..utils .plugin import Plugin as PluginType
8
10
9
11
@@ -28,7 +30,7 @@ def load_plugin(args: list = None) -> None:
28
30
os .path .dirname (path )), fg = 'red' , dim = True )
29
31
return
30
32
31
- spec = importlib .util .spec_from_file_location ('' , path )
33
+ spec = importlib .util .spec_from_file_location (str ( uuid . uuid4 ())[: 8 ] , path )
32
34
plugin = spec .loader .load_module ()
33
35
spec .loader .exec_module (plugin )
34
36
@@ -53,7 +55,5 @@ def load_plugin(args: list = None) -> None:
53
55
click .secho ('{0}' .format (traceback .format_exc ()), dim = True )
54
56
return
55
57
56
- from ..console import commands
57
58
commands .COMMANDS ['plugin' ]['commands' ][instance .namespace ] = instance .implementation
58
-
59
59
click .secho ('Loaded plugin: {0}' .format (plugin .__name__ ), bold = True )
You can’t perform that action at this time.
0 commit comments