diff --git a/debian/changelog b/debian/changelog
index e0c9f195ca5dac4da743cf52476512ef2483fe7e..17f10e60c4a23673f6659d6d19101598ab691ba1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+python-defaults (2.7.3~rc2-2) unstable; urgency=low
+
+  * dh_python2: remove even more \.so.* dangling symlinks, thanks to Stefano
+    Rivera for providing a test case
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sun, 10 Jun 2012 13:52:38 +0200
+
 python-defaults (2.7.3~rc2-1) unstable; urgency=low
 
   [ Scott Kitterman ]
diff --git a/dh_python2 b/dh_python2
index fb080c2862a183f43948f38d58dc54a36cfbcc7d..95e3467fb83df3bdd25fb408eb8568487c760d8c 100755
--- a/dh_python2
+++ b/dh_python2
@@ -380,6 +380,11 @@ def scan(package, dname=None, clean_dbg_pkg=True):
             fpath = join(root, fn)
             if not exists(fpath):
                 # could be removed while handling .so symlinks
+                if islink(fpath) and '.so.' in split(fpath)[-1]:
+                    # dangling symlink to (now removed/renamed) .so file
+                    # which wasn't removed yet (see test3's quux.so.0)
+                    log.info('removing symlink: %s', fpath)
+                    os.remove(fpath)
                 continue
             fext = fn.rsplit('.', 1)[-1]
             if fext in ('pyc', 'pyo'):
diff --git a/tests/t3/Makefile b/tests/t3/Makefile
index 96032f839342b7f2de6692b1e4be5cae80570314..2a1727900df4d934167f26344088b230aec4dd9f 100644
--- a/tests/t3/Makefile
+++ b/tests/t3/Makefile
@@ -17,6 +17,10 @@ check:
 	test -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so
 	test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1
 	test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1.2
+	test -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so
+	test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0
+	test ! -L debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0
+	test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0
 
 clean:
 	./debian/rules clean
diff --git a/tests/t3/debian/rules b/tests/t3/debian/rules
index 0915111bacd46d75f7679b1a47af1e422e18f691..7ce8185d47449d80e95288252750db6995cbfe3b 100755
--- a/tests/t3/debian/rules
+++ b/tests/t3/debian/rules
@@ -19,4 +19,12 @@ override_dh_pysupport:
 		/usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1
 	dh_link /usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1 \
 		/usr/lib/python${DPY}/dist-packages/foo/baz.so
+	# ... second style of multiple symlinks
+	cp debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/bar.so \
+	   debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0
+	dh_link /usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0 \
+		/usr/lib/python${DPY}/dist-packages/foo/quux.so.0
+	dh_link /usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0 \
+		/usr/lib/python${DPY}/dist-packages/foo/quux.so
+	# ... and complex multiple symlinks
 	DH_VERBOSE=1 ../../dh_python2