Revision 1227 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib/pylint/lint.py

View differences:

lint.py
59 59
SYMBOLS_HELP = ("Deprecated. It was used to include symbolic ids of "
60 60
                "messages in output. Use --msg-template instead.")
61 61

  
62
def sys_path():
63
  if sys.getClassLoader()!=None:
64
    path = getattr(sys.getClassLoader(),"path",None)
65
    if path != None:
66
      return path(sys.path)
67
  path = [ folder for folder in sys.path if not folder.startswith("__") ]
68
  return path
69

  
62 70
def _get_new_args(message):
63 71
    location = (
64 72
        message.abspath,
......
1121 1129
    We avoid adding duplicate directories to sys.path.
1122 1130
    `sys.path` is reset to its original value upon exitign this context.
1123 1131
    """
1124
    orig = list(sys.path)
1132
    orig = list(sys_path())
1125 1133
    changes = []
1126 1134
    for arg in args:
1127 1135
        path = _get_python_path(arg)
......
1129 1137
            continue
1130 1138
        else:
1131 1139
            changes.append(path)
1132
    sys.path[:] = changes + sys.path
1140
    sys.path[:] = changes + sys_path()
1133 1141
    try:
1134 1142
        yield
1135 1143
    finally:

Also available in: Unified diff