Skip to content

Commit 30a7c24

Browse files
committed
fix(examples): tenants is indexed as a list the line below, bet filter returns a generator
With list comprehension the code is also simpler
1 parent 836fd0e commit 30a7c24

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

examples/get_tenant_token.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
if len(sys.argv) > 2:
1919
# Filter tenants that matches the provided pattern
20-
tenants = filter(lambda tenant: sys.argv[2] in tenant.name, tenants)
20+
pattern = sys.argv[2]
21+
tenants = [t for t in tenants if pattern in t.name]
2122

2223
# Pick the first one
2324
tenant = tenants[0]

0 commit comments

Comments
 (0)