Fixes syntax error in older versions of graphviz.
Older versions of graphviz (tested on version 2.26.3 (20100126.1600)) complains when an attribute is empty without quotes. [label=] fails but [label=""] works, so the quote_if_necessary function has been updated to accommodate this.
This commit is contained in:
parent
875bbfd89c
commit
13686776b9
@ -257,6 +257,10 @@ def needs_quotes(s):
|
||||
|
||||
|
||||
def quote_if_necessary(s):
|
||||
# Older versions of graphviz throws a syntax error for empty values without
|
||||
# quotes, e.g. [label=]
|
||||
if s == '':
|
||||
return '""'
|
||||
|
||||
if isinstance(s, bool):
|
||||
if s is True:
|
||||
|
Loading…
Reference in New Issue
Block a user