Skip to content

Commit

Permalink
Merge pull request #919 from ZLLentz/fix_empty_display_stylesheet
Browse files Browse the repository at this point in the history
FIX: skip non-file stylesheets such as empty string
  • Loading branch information
jbellister-slac authored Sep 14, 2022
2 parents 1343b62 + fb34037 commit 23db1d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydm/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ def setStyleSheet(self, new_stylesheet):
stylesheet_filename = None
try:
#First, check if the file is already an absolute path.
if os.path.exists(possible_stylesheet_filename):
if os.path.isfile(possible_stylesheet_filename):
stylesheet_filename = possible_stylesheet_filename
#Second, check if the css file is specified relative to the display file.
else:
rel_path = os.path.join(os.path.dirname(os.path.abspath(self._loaded_file)), possible_stylesheet_filename)
if os.path.exists(rel_path):
if os.path.isfile(rel_path):
stylesheet_filename = rel_path
except Exception as e:
logger.debug("Exception while checking if stylesheet is a filename: %s", e)
Expand Down

0 comments on commit 23db1d1

Please sign in to comment.