Skip to content

Commit aabd237

Browse files
committed
Fixed some pyflakes issues.
- Legacy-Id: 17304
1 parent ab99478 commit aabd237

2 files changed

Lines changed: 7 additions & 27 deletions

File tree

ietf/utils/management/commands/mergedata.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,24 @@
33

44
from __future__ import absolute_import, print_function, unicode_literals
55

6-
import glob
7-
import gzip
86
import os
97
import warnings
10-
import zipfile
118

12-
from collections import defaultdict
13-
from itertools import product, chain
9+
from itertools import chain
1410

1511
import debug # pyflakes:ignore
1612

17-
from django.apps import apps
1813
from django.conf import settings
19-
from django.contrib.admin.utils import NestedObjects
2014
from django.core import serializers
21-
from django.core.exceptions import ImproperlyConfigured
22-
from django.core.management.base import BaseCommand, CommandError
23-
from django.core.management.color import no_style
24-
from django.core.management.commands.loaddata import Command as LoadCommand, SingleZipReader, humanize
25-
from django.core.management.utils import parse_apps_and_model_labels
26-
from django.db import DEFAULT_DB_ALIAS, DatabaseError, IntegrityError, connections, router, transaction
15+
from django.core.management.base import CommandError
16+
from django.core.management.commands.loaddata import Command as LoadCommand, humanize
17+
from django.db import DatabaseError, IntegrityError, router, transaction
2718
from django.db.models import ManyToManyField
28-
from django.utils import lru_cache
29-
from django.utils._os import upath
3019
from django.utils.encoding import force_text
31-
from django.utils.functional import cached_property
32-
from django.utils.glob import glob_escape
3320

3421
from ietf.utils.models import ForeignKey
3522

3623

37-
try:
38-
import bz2
39-
has_bz2 = True
40-
except ImportError:
41-
has_bz2 = False
42-
43-
4424
def flatten(l):
4525
if isinstance(l, list):
4626
for el in l:

ietf/utils/management/commands/sqldumpdump.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import io
77
import re
88
import sys
9-
import warnings
9+
1010

1111
from django.apps import apps
1212
from django.core import serializers
@@ -110,7 +110,7 @@ def get_pks(self, filenames, tables):
110110
if not table in pks:
111111
pks[table] = []
112112
fields = match.group('fields')
113-
fields = [ f.strip("`") for f in re.split(r"(`[^`]+`)", fields) if f and not re.match(r'\s*,\s*', f)]
113+
fields = [ f.strip("`") for f in re.split(r"(`[^`]+`)", fields) if f and not re.match(r'\s*,\s*', f)] # pyflakes:ignore
114114
values = match.group('values')
115115
values = [ v.strip("'") for v in re.split(r"(\d+|'[^']*'|NULL)", values) if v and not re.match(r'\s*,\s*', v) ]
116116
try:
@@ -119,7 +119,7 @@ def get_pks(self, filenames, tables):
119119
pk = values[ididx]
120120
pks[table].append(pk)
121121
count += 1
122-
except (KeyError, ValueError) as e:
122+
except (KeyError, ValueError):
123123
pass
124124
return pks, count
125125

0 commit comments

Comments
 (0)