Skip to content

Commit

Permalink
Set GMT_SESSION_NAME to the current process id
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Aug 24, 2024
1 parent 7753b9c commit 90ad065
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
data_kind,
tempfile_from_geojson,
tempfile_from_image,
unique_name,
)

FAMILIES = [
Expand Down Expand Up @@ -215,8 +214,8 @@ def __enter__(self):
_init_cli_session = False
# This is the first time a Session object is created.
if _STATE["session_name"] is None:
# Set GMT_SESSION_NAME to a customized, unique value.
_STATE["session_name"] = os.environ["GMT_SESSION_NAME"] = unique_name()
# Set GMT_SESSION_NAME to the current process id.
_STATE["session_name"] = os.environ["GMT_SESSION_NAME"] = str(os.getpid())
# Need to initialize the GMT CLI session.
_init_cli_session = True
self.create("pygmt-session")
Expand Down

0 comments on commit 90ad065

Please sign in to comment.