diff --git a/doc/rst2man.py b/doc/rst2man.py
index 5326800d69376a719f6893f2c9ac324a1d134405_ZG9jL3JzdDJtYW4ucHk=..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_ZG9jL3JzdDJtYW4ucHk= 100755
--- a/doc/rst2man.py
+++ b/doc/rst2man.py
@@ -112,7 +112,7 @@
 class Table:
     def __init__(self):
         self._rows = []
-        self._options = ['center',]
+        self._options = ['center']
         self._tab_char = '\t'
         self._coldefs = []
     def new_row(self):
diff --git a/hgext/mq.py b/hgext/mq.py
index 5326800d69376a719f6893f2c9ac324a1d134405_aGdleHQvbXEucHk=..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_aGdleHQvbXEucHk= 100644
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -859,7 +859,8 @@
                         p.write("Date: %d %d\n\n" % date)
                 else:
                     p.write("# HG changeset patch\n")
-                    p.write("# Parent " + hex(repo[None].parents()[0].node()) + "\n")
+                    p.write("# Parent "
+                            + hex(repo[None].parents()[0].node()) + "\n")
                     if user:
                         p.write("# User " + user + "\n")
                     if date:
diff --git a/hgext/rebase.py b/hgext/rebase.py
index 5326800d69376a719f6893f2c9ac324a1d134405_aGdleHQvcmViYXNlLnB5..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_aGdleHQvcmViYXNlLnB5 100644
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -499,7 +499,7 @@
         ('', 'detach', False, _('force detaching of source from its original '
                                 'branch')),
         ('c', 'continue', False, _('continue an interrupted rebase')),
-        ('a', 'abort', False, _('abort an interrupted rebase')),] +
+        ('a', 'abort', False, _('abort an interrupted rebase'))] +
          templateopts,
         _('hg rebase [-s REV | -b REV] [-d REV] [--collapse] [--detach] '
                         '[--keep] [--keepbranches] | [-c] | [-a]')),
diff --git a/mercurial/commands.py b/mercurial/commands.py
index 5326800d69376a719f6893f2c9ac324a1d134405_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1835,7 +1835,8 @@
     wlock = lock = None
 
     def tryone(ui, hunk):
-        tmpname, message, user, date, branch, nodeid, p1, p2 = patch.extract(ui, hunk)
+        tmpname, message, user, date, branch, nodeid, p1, p2 = \
+            patch.extract(ui, hunk)
 
         if not tmpname:
             return None
diff --git a/tests/coverage.py b/tests/coverage.py
index 5326800d69376a719f6893f2c9ac324a1d134405_dGVzdHMvY292ZXJhZ2UucHk=..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_dGVzdHMvY292ZXJhZ2UucHk= 100755
--- a/tests/coverage.py
+++ b/tests/coverage.py
@@ -847,7 +847,7 @@
         morfs = self.filter_by_prefix(morfs, omit_prefixes)
         morfs.sort(self.morf_name_compare)
 
-        max_name = max([5,] + map(len, map(self.morf_name, morfs)))
+        max_name = max([5] + map(len, map(self.morf_name, morfs)))
         fmt_name = "%%- %ds  " % max_name
         fmt_err = fmt_name + "%s: %s"
         header = fmt_name % "Name" + " Stmts   Exec  Cover"
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 5326800d69376a719f6893f2c9ac324a1d134405_dGVzdHMvcnVuLXRlc3RzLnB5..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_dGVzdHMvcnVuLXRlc3RzLnB5 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -785,7 +785,7 @@
                     if k in t:
                         break
                 else:
-                    skipped +=1
+                    skipped += 1
                     continue
 
             ret = runone(options, test, skips, fails)
diff --git a/tests/test-doctest.py b/tests/test-doctest.py
index 5326800d69376a719f6893f2c9ac324a1d134405_dGVzdHMvdGVzdC1kb2N0ZXN0LnB5..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_dGVzdHMvdGVzdC1kb2N0ZXN0LnB5 100644
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -1,5 +1,5 @@
 # this is hack to make sure no escape characters are inserted into the output
-import os;
+import os
 if 'TERM' in os.environ:
     del os.environ['TERM']
 import doctest
diff --git a/tests/test-mq-header-from b/tests/test-mq-header-from
index 5326800d69376a719f6893f2c9ac324a1d134405_dGVzdHMvdGVzdC1tcS1oZWFkZXItZnJvbQ==..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_dGVzdHMvdGVzdC1tcS1oZWFkZXItZnJvbQ== 100755
--- a/tests/test-mq-header-from
+++ b/tests/test-mq-header-from
@@ -148,4 +148,4 @@
 (cd sandbox ; runtest)
 rm -r sandbox
 
-runtest
\ No newline at end of file
+runtest
diff --git a/tests/test-simplemerge.py b/tests/test-simplemerge.py
index 5326800d69376a719f6893f2c9ac324a1d134405_dGVzdHMvdGVzdC1zaW1wbGVtZXJnZS5weQ==..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_dGVzdHMvdGVzdC1zaW1wbGVtZXJnZS5weQ== 100644
--- a/tests/test-simplemerge.py
+++ b/tests/test-simplemerge.py
@@ -143,7 +143,7 @@
         # to match without zz
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  2, 3,  0, 1),
-                           (1, 1,  3, 3,  1, 1),])
+                           (1, 1,  3, 3,  1, 1)])
 
         self.assertEquals(list(m3.merge_regions()),
                           [('a', 0, 2),
@@ -180,8 +180,8 @@
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  0, 1,  0, 1),
                            (1, 2,  2, 3,  1, 2),
-                           (2, 2,  3, 3,  2, 2),])
+                           (2, 2,  3, 3,  2, 2)])
 
         self.assertEquals(list(m3.merge_regions()),
                           [('unchanged', 0, 1),
                            ('a', 1, 2),
@@ -184,8 +184,8 @@
 
         self.assertEquals(list(m3.merge_regions()),
                           [('unchanged', 0, 1),
                            ('a', 1, 2),
-                           ('unchanged', 1, 2),])
+                           ('unchanged', 1, 2)])
 
     def test_append_a(self):
         m3 = Merge3(['aaa\n', 'bbb\n'],
@@ -256,7 +256,7 @@
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  0, 1,  0, 1),
                            (1, 2,  2, 3,  2, 3),
-                           (2, 2,  3, 3,  3, 3),])
+                           (2, 2,  3, 3,  3, 3)])
 
         self.assertEquals(list(m3.merge_regions()),
                           [('unchanged', 0, 1),
@@ -296,7 +296,7 @@
         self.assertEquals(list(m3.find_sync_regions()),
                           [(0, 1,  0, 1,  0, 1),
                            (2, 3,  2, 3,  2, 3),
-                           (3, 3,  3, 3,  3, 3),])
+                           (3, 3,  3, 3,  3, 3)])
 
     def test_replace_multi(self):
         """Replacement with regions of different size."""
diff --git a/tests/test-subrepo b/tests/test-subrepo
index 5326800d69376a719f6893f2c9ac324a1d134405_dGVzdHMvdGVzdC1zdWJyZXBv..e433002acb05d36264016b7dc9bbd4fd4cc08f1c_dGVzdHMvdGVzdC1zdWJyZXBv 100755
--- a/tests/test-subrepo
+++ b/tests/test-subrepo
@@ -175,7 +175,7 @@
 hg -R nested_relative ci -mtest2
 hg init main
 echo nested_relative = ../nested_relative > main/.hgsub
-echo nested_absolute = $PWD/nested_absolute >> main/.hgsub
+echo nested_absolute = `pwd`/nested_absolute >> main/.hgsub
 hg -R main add
 hg -R main ci -m "add subrepos"
 cd ..