File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,20 +114,18 @@ class InvalidProject(Exception):
114114 pass
115115
116116
117- try :
118- import dateutil .parser
119- from dateutil .tz import tzlocal
120- except ImportError :
121- # this is to import all dependencies shipped with package (e.g. to use in qgis-plugin)
122- deps_dir = os .path .join (this_dir , "deps" )
123- if os .path .exists (deps_dir ):
124- import sys
125-
126- for f in os .listdir (os .path .join (deps_dir )):
127- sys .path .append (os .path .join (deps_dir , f ))
128-
129- import dateutil .parser
130- from dateutil .tz import tzlocal
117+ # add dependencies shipped in deps/ on sys.path
118+ deps_dir = os .path .join (this_dir , "deps" )
119+ if os .path .exists (deps_dir ):
120+ import sys
121+
122+ for f in os .listdir (deps_dir ):
123+ dep_path = os .path .join (deps_dir , f )
124+ if dep_path not in sys .path :
125+ sys .path .append (dep_path )
126+
127+ import dateutil .parser
128+ from dateutil .tz import tzlocal
131129
132130
133131class WorkspaceRole (Enum ):
You can’t perform that action at this time.
0 commit comments