Skip to content

Commit

Permalink
Simplify unasync
Browse files Browse the repository at this point in the history
  • Loading branch information
karpetrosyan committed Aug 11, 2023
1 parent b0c8ac5 commit ec7a887
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions unasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import re
import sys
from pprint import pprint

SUBS = [
('from .._backends.auto import AutoBackend', 'from .._backends.sync import SyncBackend'),
Expand Down Expand Up @@ -82,13 +83,8 @@ def main():
unasync_dir("tests/_async", "tests/_sync", check_only=check_only)

if len(USED_SUBS) != len(SUBS):
unused_subs = []
unused_subs = [SUBS[i] for i in range(len(SUBS)) if i not in USED_SUBS]

for i in range(len(SUBS)):
if i not in USED_SUBS:
unused_subs.append(SUBS[i])

from pprint import pprint
print("These patterns were not used:")
pprint(unused_subs)
exit(1)
Expand Down

0 comments on commit ec7a887

Please sign in to comment.