Skip to content

Commit

Permalink
grass.script: Always use full env in create_project (#3685)
Browse files Browse the repository at this point in the history
For reporting errors the g.message tool is called, so the environment setup is always needed (except when doing XY without errors).
  • Loading branch information
wenzeslaus authored May 4, 2024
1 parent da58536 commit 77b3a16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/grass/script/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1760,11 +1760,11 @@ def create_project(
env = os.environ.copy()
setup_runtime_env(env=env)

if epsg or proj4 or filename or wkt:
# The names don't really matter here.
tmp_gisrc, env = create_environment(
mapset_path.directory, mapset_path.location, mapset_path.mapset, env=env
)
# Even g.proj and g.message need GISRC to be present.
# The names don't really matter here.
tmp_gisrc, env = create_environment(
mapset_path.directory, mapset_path.location, mapset_path.mapset, env=env
)

# check if location already exists
if Path(mapset_path.directory, mapset_path.location).exists():
Expand Down

0 comments on commit 77b3a16

Please sign in to comment.