Hey,

I've attached a patch to fix ticket #4595. It's a trivial change, but please
let me know whether the patch is up to standard.

Thanks very much!
-Sarah Strong
diff --git a/checkers/format.py b/checkers/format.py
--- a/checkers/format.py
+++ b/checkers/format.py
@@ -108,7 +108,7 @@
      re.compile(OP_RGX_SEARCH_2, re.M),
      'C0323'),
 
-    (re.compile(r'.*,[^\s)].*', re.M),
+    (re.compile(r'.*,[^(\s|\]|}|\))].*', re.M), 
      re.compile(r',[^\s)]', re.M),
      'C0324'),
     )
diff --git a/test/test_format.py b/test/test_format.py
--- a/test/test_format.py
+++ b/test/test_format.py
@@ -147,6 +147,18 @@
                          ('C0324', 'a, b = 1,2\n        ^^'))
 
         
+    def test_known_values_commaspace_2(self):
+        self.assertEqual(check_line('should_not_warn = [1, 2, 3,]\n', REPORTER),
+                         None)
+
+    def test_known_values_commaspace_3(self):
+        self.assertEqual(check_line('should_not_warn = {1:2, 3:4,}\n', REPORTER),
+                         None)
+
+    def test_known_values_commaspace_4(self):
+        self.assertEqual(check_line('should_not_warn = (1, 2, 3,)\n', REPORTER),
+                         None)
+                
     def test_known_values_instring_1(self):
         self.assertEqual(check_line('f("a=1")', REPORTER), None)
         
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to