Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code for flake8-comprehensions C420 #473

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/django_upgrade/fixers/compatibility_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@
"django.contrib.staticfiles.templatetags.staticfiles": {
"static": "django.templatetags.static",
},
"django.core.urlresolvers": {
"django.core.urlresolvers": dict.fromkeys(
# Objects moved from django.core.resolvers to django.urls in
# Django 1.10:
# https:/django/django/blob/stable/1.10.x/django/urls/__init__.py
# The following are excluded because they were removed in Django
# 2.0: RegexURLPattern, LocaleRegexURLResolver, RegexURLResolver
# and LocaleRegexProvider. See:
# https:/django/django/pull/7482#discussion_r121311884
name: "django.urls"
for name in (
(
"NoReverseMatch",
"Resolver404",
"ResolverMatch",
Expand All @@ -87,8 +86,9 @@
"set_script_prefix",
"set_urlconf",
"translate_url",
)
},
),
"django.urls",
),
},
(1, 11): {
"django.db.models.fields": {
Expand Down
2 changes: 1 addition & 1 deletion src/django_upgrade/fixers/django_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def update_django_conf_import(
tokens,
i,
node=node,
name_map={name: "" for name in removals},
name_map=dict.fromkeys(removals, ""),
)
if not re_path_imported:
joined_names = ", ".join(sorted(added_names))
Expand Down