Skip to content

Commit a3cf394

Browse files
committed
Making __repr__ actually work
1 parent 84b8254 commit a3cf394

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rdflib_sqlalchemy/store.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,14 @@ def __repr__(self):
168168
typeLen, quotedLen, assertedLen, literalLen = [
169169
rtTuple[0] for rtTuple in rt]
170170
try:
171-
return ("<Partitioned SQL N3 Store: %s " +
172-
"contexts, %s classification assertions, " +
173-
"%s quoted statements, %s property/value " +
171+
return ("<Partitioned SQL N3 Store: %s "
172+
"contexts, %s classification assertions, "
173+
"%s quoted statements, %s property/value "
174174
"assertions, and %s other assertions>" % (
175-
len([ctx for ctx in self.contexts()]),
175+
sum(1 for _ in self.contexts()),
176176
typeLen, quotedLen, literalLen, assertedLen))
177177
except Exception:
178+
_logger.exception('Error creating repr')
178179
return "<Partitioned SQL N3 Store>"
179180
else:
180181
return "<Partitioned unopened SQL N3 Store>"

0 commit comments

Comments
 (0)