title: What is the best way to deal with "_d" suffix for C extensions when using debug build?
body: <p>I'm trying to debug my C extension for Python 2.7. I use python2.7 debug build. I build my project with <code>setuptools</code> and my <code>setup.py</code> has such lines:</p>
  
  <pre><code>ext_modules=[Extension("my.extension",
                         ["my/_extension.c"])]
  </code></pre>
  
  <p>When I invoke <code>python setup.py install</code> for some reason extension compiles to a file with <code>_d</code> suffix, and after that, in Python, I can't do <code>import my.extension</code>, I can only do <code>import my.extension_d</code>. And what I get is:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "build/bdist.linux-x86_64/egg/my/extension_d.py", line 7, in &lt;module&gt;
    File "build/bdist.linux-x86_64/egg/my/extension_d.py", line 6, in __bootstrap__
  ImportError: dynamic module does not define init function (initextension_d)
  </code></pre>
  
  <p>Of course my extension does not have <code>initextension_d</code>, it only has <code>initextension</code> function.</p>
  
  <p>This is very incovenient, because I have to change some code and add this <code>_d</code> suffix to imports and other stuff.</p>
  
  <p>Is it possible to turn off prepending of this suffix? Or how to deal with that problem in other way? Maybe there are some "official" ways?</p>
  
  <h2>UPDATE #0</h2>
  
  <p>I use Ubuntu Linux.</p>