Skip to content

Commit 916d5be

Browse files
datapythonistajreback
authored andcommitted
Fixing flake8 problems new to flake8 3.6.0 (#23472)
1 parent f7f0c59 commit 916d5be

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

doc/source/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
# JP: added from sphinxdocs
100100
autosummary_generate = False
101101

102-
if any(re.match("\s*api\s*", l) for l in index_rst_lines):
102+
if any(re.match(r"\s*api\s*", l) for l in index_rst_lines):
103103
autosummary_generate = True
104104

105105
# numpydoc
@@ -341,8 +341,8 @@
341341
# file, target name, title, author, documentclass [howto/manual]).
342342
latex_documents = [
343343
('index', 'pandas.tex',
344-
u'pandas: powerful Python data analysis toolkit',
345-
u'Wes McKinney\n\& PyData Development Team', 'manual'),
344+
'pandas: powerful Python data analysis toolkit',
345+
r'Wes McKinney\n\& PyData Development Team', 'manual'),
346346
]
347347

348348
# The name of an image file (relative to this directory) to place at the top of

scripts/find_commits_touching_func.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
argparser.add_argument('funcname', metavar='FUNCNAME',
3232
help='Name of function/method to search for changes on')
3333
argparser.add_argument('-f', '--file-masks', metavar='f_re(,f_re)*',
34-
default=["\.py.?$"],
34+
default=[r"\.py.?$"],
3535
help='comma separated list of regexes to match '
3636
'filenames against\ndefaults all .py? files')
3737
argparser.add_argument('-d', '--dir-masks', metavar='d_re(,d_re)*',
@@ -80,7 +80,7 @@ def get_hits(defname, files=()):
8080
try:
8181
r = sh.git('blame',
8282
'-L',
83-
'/def\s*{start}/,/def/'.format(start=defname),
83+
r'/def\s*{start}/,/def/'.format(start=defname),
8484
f,
8585
_tty_out=False)
8686
except sh.ErrorReturnCode_128:
@@ -89,7 +89,7 @@ def get_hits(defname, files=()):
8989

9090
lines = r.strip().splitlines()[:-1]
9191
# remove comment lines
92-
lines = [x for x in lines if not re.search("^\w+\s*\(.+\)\s*#", x)]
92+
lines = [x for x in lines if not re.search(r"^\w+\s*\(.+\)\s*#", x)]
9393
hits = set(map(lambda x: x.split(" ")[0], lines))
9494
cs.update({Hit(commit=c, path=f) for c in hits})
9595

scripts/find_undoc_args.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def build_loc(f):
6565
sig_names = set(inspect.getargspec(f).args)
6666
# XXX numpydoc can be used to get the list of parameters
6767
doc = f.__doc__.lower()
68-
doc = re.split('^\s*parameters\s*', doc, 1, re.M)[-1]
69-
doc = re.split('^\s*returns*', doc, 1, re.M)[0]
68+
doc = re.split(r'^\s*parameters\s*', doc, 1, re.M)[-1]
69+
doc = re.split(r'^\s*returns*', doc, 1, re.M)[0]
7070
doc_names = {x.split(":")[0].strip() for x in doc.split('\n')
71-
if re.match('\s+[\w_]+\s*:', x)}
71+
if re.match(r'\s+[\w_]+\s*:', x)}
7272
sig_names.discard('self')
7373
doc_names.discard('kwds')
7474
doc_names.discard('kwargs')

0 commit comments

Comments
 (0)