Patchwork [3,of,7] check-code: reject import Queue, suggest util.queue class for py3 compat

login
register
mail settings
Submitter timeless@mozdev.org
Date April 6, 2016, 9:57 p.m.
Message ID <bcdf9805314cdeeb236a.1459979860@waste.org>
Download mbox | patch
Permalink /patch/14403/
State Accepted
Headers show

Comments

timeless@mozdev.org - April 6, 2016, 9:57 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459973298 0
#      Wed Apr 06 20:08:18 2016 +0000
# Node ID bcdf9805314cdeeb236acfb55f080f22fcad603a
# Parent  ffdf8b429336f3b9d1ff5f035b2271592a1b9679
check-code: reject import Queue, suggest util.queue class for py3 compat

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -315,6 +315,7 @@ 
     # XXX only catch mutable arguments on the first line of the definition
     (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"),
     (r'\butil\.Abort\b', "directly use error.Abort"),
+    (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
   ],
   # warnings
   [