Skip to content

Commit

Permalink
checks that the file is not on server
Browse files Browse the repository at this point in the history
  • Loading branch information
yohaimagen committed Aug 17, 2021
1 parent 7498ec6 commit 8a20e99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pygmt/src/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
plot - Plot in two dimensions.
"""
import os

from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
Expand Down Expand Up @@ -207,7 +209,7 @@ def plot(self, x=None, y=None, data=None, size=None, direction=None, **kwargs):
extra_arrays = []
if "S" in kwargs and kwargs["S"][0] in "vV" and direction is not None:
extra_arrays.extend(direction)
if "S" not in kwargs and kind == "file":
if "S" not in kwargs and kind == "file" and os.path.exists(data):
with open(data, "r") as file:
line = file.readline()
if "@GMULTIPOINT" in line or "@GPOINT" in line:
Expand Down

0 comments on commit 8a20e99

Please sign in to comment.