diff --git a/debian/changelog b/debian/changelog
index 11ddac29ce2bd55b953782597e9a6f3a4fb0e862..df7e01ca6024499172bb9328440f7d04a8adab1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ python-defaults (2.7.2-2) UNRELEASED; urgency=low
       Leonid Borisenko for the original patch)
     - add --ignore-shebangs option that will disable translating shebangs into
       Debian dependencies
+    - add --ignore-namespace option that will disable handling
+      Egg-info's namespace_packages.txt (AKA namespace feature)
 
  -- Piotr Ożarowski <piotr@debian.org>  Sun, 12 Jun 2011 13:28:48 +0200
 
diff --git a/dh_python2 b/dh_python2
index b441decf136d7ae9399e7c966ea63909af3604ce..f512ba784fac20f01a680d86a3223697aae2a5aa 100755
--- a/dh_python2
+++ b/dh_python2
@@ -257,7 +257,8 @@ def share_2x(dir1, dir2, dc=None):
                 # directories with .so files will be blocked earlier
                 common_files.append(i)
     elif islink(dir1):
-        # skip this symlink in pyshared (dpkg has problems with symlinks anyway)
+        # skip this symlink in pyshared
+        # (dpkg has problems with symlinks anyway)
         common_dirs = []
         common_files = []
     else:
@@ -488,6 +489,8 @@ def main():
         help='generate maintainer script that will remove pycentral files')
     parser.add_option('--ignore-shebangs', action='store_true', default=False,
         help='do not translate shebangs into Debian dependencies')
+    parser.add_option('--ignore-namespace', action='store_true', default=False,
+        help="ignore Egg's namespace_packages.txt file and --namespace option")
     # ignore some debhelper options:
     parser.add_option('-O', help=SUPPRESS_HELP)
 
@@ -572,7 +575,8 @@ def main():
         pyclean_added = False  # invoke pyclean only once in maintainer script
         if stats['compile']:
             if options.clean_pycentral:
-                dh.autoscript(package, 'preinst', 'preinst-pycentral-clean', '')
+                dh.autoscript(package, 'preinst',
+                              'preinst-pycentral-clean', '')
             dh.autoscript(package, 'postinst', 'postinst-pycompile', '')
             dh.autoscript(package, 'prerm', 'prerm-pyclean', '')
             pyclean_added = True
@@ -622,14 +626,19 @@ def main():
                 fcopy(pydist_file, join(dstdir, package))
 
         # namespace feature - recreate __init__.py files at install time
-        nsp = ns.parse(stats['nsp.txt'], options.namespaces)
+        if options.ignore_namespace:
+            nsp = None
+        else:
+            nsp = ns.parse(stats['nsp.txt'], options.namespaces)
         # note that pycompile/pyclean is already added to maintainer scripts
         # and it should remain there even if __init__.py was the only .py file
-        try:
-            nsp = ns.remove_from_package(package, nsp, stats['public_vers'])
-        except (IOError, OSError), e:
-            log.error('cannot remove __init__.py from package: %s', e)
-            exit(6)
+        if nsp:
+            try:
+                nsp = ns.remove_from_package(package, nsp,
+                                             stats['public_vers'])
+            except (IOError, OSError), e:
+                log.error('cannot remove __init__.py from package: %s', e)
+                exit(6)
         if nsp:
             dstdir = join('debian', package, 'usr/share/python/ns/')
             if not exists(dstdir):
diff --git a/dh_python2.rst b/dh_python2.rst
index bc2db930db30a5fa4d6097670b6f918c53c02152..4f5dc6b3a50e4739aa162e4fc49a65ecf22c8f25 100644
--- a/dh_python2.rst
+++ b/dh_python2.rst
@@ -97,6 +97,11 @@ OPTIONS
 --namespace	use this option (multiple time if necessary) if
   namespace_packages.txt is not complete
 
+--ignore-namespace	ignore Egg's namespace declaration and
+  --namespace option. This option will disable removing (and recreating at
+  install time) empty __init__.py files. Removing namespace_packages.txt from
+  egg-info directory has the same effect.
+
 --clean-pycentral	generate maintainer script that will remove byte code
   generated by python-central helper