Skip to content

Commit c1e68b8

Browse files
committed
More Black formatting changes
1 parent 89cb369 commit c1e68b8

File tree

6 files changed

+74
-59
lines changed

6 files changed

+74
-59
lines changed

rdflib/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@
9292
try:
9393
import __main__
9494

95-
if not hasattr(__main__, "__file__") and sys.stdout is not None and sys.stderr.isatty():
95+
if (
96+
not hasattr(__main__, "__file__")
97+
and sys.stdout is not None
98+
and sys.stderr.isatty()
99+
):
96100
# show log messages in interactive mode
97101
_interactive_mode = True
98102
logger.setLevel(logging.INFO)

rdflib/compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _refine(self, coloring, sequence):
335335
coloring.extend(colors)
336336
try:
337337
si = sequence.index(c)
338-
sequence = sequence[:si] + colors + sequence[si + 1:]
338+
sequence = sequence[:si] + colors + sequence[si + 1 :]
339339
except ValueError:
340340
sequence = colors[1:] + sequence
341341
combined_colors = []

rdflib/graph.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,17 @@ def preferredLabel(
778778
# setup the language filtering
779779
if lang is not None:
780780
if lang == "": # we only want not language-tagged literals
781+
781782
def langfilter(l_):
782783
return l_.language is None
784+
783785
else:
786+
784787
def langfilter(l_):
785788
return l_.language == lang
786789

787790
else: # we don't care about language tags
791+
788792
def langfilter(l_):
789793
return True
790794

@@ -1072,9 +1076,11 @@ def parse(
10721076
format = source.content_type
10731077
assumed_xml = False
10741078
if format is None:
1075-
if (hasattr(source, "file")
1076-
and getattr(source.file, "name", None)
1077-
and isinstance(source.file.name, str)):
1079+
if (
1080+
hasattr(source, "file")
1081+
and getattr(source.file, "name", None)
1082+
and isinstance(source.file.name, str)
1083+
):
10781084
format = rdflib.util.guess_format(source.file.name)
10791085
if format is None:
10801086
format = "application/rdf+xml"
@@ -1086,7 +1092,9 @@ def parse(
10861092
if assumed_xml:
10871093
logger.warning(
10881094
"Could not guess format for %r, so assumed xml."
1089-
" You can explicitly specify format using the format argument." % source)
1095+
" You can explicitly specify format using the format argument."
1096+
% source
1097+
)
10901098
raise saxpe
10911099
finally:
10921100
if source.auto_close:

0 commit comments

Comments
 (0)