~xnox/ubiquity/fix-value-errors

« back to all changes in this revision

Viewing changes to ubiquity/plugin_manager.py

  • Committer: Dmitrijs Ledkovs
  • Date: 2012-09-24 10:24:23 UTC
  • mfrom: (5651.1.29 trunk)
  • Revision ID: dmitrijs.ledkovs@canonical.com-20120924102423-hnsl11gra0u43pxg
catch up from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with Ubiquity.  If not, see <http://www.gnu.org/licenses/>.
20
20
 
21
 
from __future__ import print_function
22
 
 
23
21
import fnmatch
 
22
import importlib
24
23
import os
25
24
import sys
26
25
 
31
30
def load_plugin(modname):
32
31
    sys.path.insert(0, PLUGIN_PATH)
33
32
    try:
34
 
        return __import__(modname)
 
33
        return importlib.import_module(modname)
35
34
    finally:
36
35
        del sys.path[0]
37
36