title: py2app: modulegraph missing scan_code
body: <p>For some reason I can't explain or google, py2app crashes on me even with the simplest examples. Im using a python 3.4.1 virtual environment created as <code>Projects/Test/virtenv</code> which has py2app installed via pip. </p>
  
  <p>Here is the output of <code>$pip list</code>:</p>
  
  <pre><code>altgraph (0.12)
  macholib (1.7)
  modulegraph (0.12)
  pip (1.5.6)
  py2app (0.9)
  setuptools (3.6)
  </code></pre>
  
  <p>foo.py is a hello world example file saved in Projects/Test/ and contains a single line:</p>
  
  <pre><code>print('hello world')
  </code></pre>
  
  <p>setup.py is saved in Projects/Test as generated by <code>$py2applet --make-setup foo.py</code>:</p>
  
  <pre><code>"""
  This is a setup.py script generated by py2applet
  
  Usage:
      python setup.py py2app
  """
  
  from setuptools import setup
  
  APP = ['foo.py']
  DATA_FILES = []
  OPTIONS = {'argv_emulation': True}
  
  setup(
      app=APP,
      data_files=DATA_FILES,
      options={'py2app': OPTIONS},
      setup_requires=['py2app'],
  )
  </code></pre>
  
  <p>Here is the full output of running <code>$python setup.py py2app</code> (all pip and python commands were done with the virtual enviroment activated) :</p>
  
  <pre><code>running py2app
  creating /Users/mik/Desktop/Projects/Test/build
  creating /Users/mik/Desktop/Projects/Test/build/bdist.macosx-10.8-x86_64
  creating /Users/mik/Desktop/Projects/Test/build/bdist.macosx-10.8-x86_64/python3.4-standalone
  creating /Users/mik/Desktop/Projects/Test/build/bdist.macosx-10.8-x86_64/python3.4-standalone/app
  creating /Users/mik/Desktop/Projects/Test/build/bdist.macosx-10.8-x86_64/python3.4-standalone/app/collect
  creating /Users/mik/Desktop/Projects/Test/build/bdist.macosx-10.8-x86_64/python3.4-standalone/app/temp
  creating /Users/mik/Desktop/Projects/Test/dist
  creating build/bdist.macosx-10.8-x86_64/python3.4-standalone/app/lib-dynload
  creating build/bdist.macosx-10.8-x86_64/python3.4-standalone/app/Frameworks
  *** using recipe: lxml ***
  *** using recipe: ftplib ***
  *** using recipe: sip ***
  *** using recipe: ctypes ***
  *** using recipe: xml ***
  *** using recipe: pydoc ***
  Traceback (most recent call last):
    File "setup.py", line 18, in &lt;module&gt;
      setup_requires=['py2app'],
    File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/mik/Desktop/Projects/Test/virtenv/lib/python3.4/site-packages/py2app/build_app.py", line 659, in run
      self._run()
    File "/Users/mik/Desktop/Projects/Test/virtenv/lib/python3.4/site-packages/py2app/build_app.py", line 865, in _run
      self.run_normal()
    File "/Users/mik/Desktop/Projects/Test/virtenv/lib/python3.4/site-packages/py2app/build_app.py", line 943, in run_normal
      self.process_recipes(mf, filters, flatpackages, loader_files)
    File "/Users/mik/Desktop/Projects/Test/virtenv/lib/python3.4/site-packages/py2app/build_app.py", line 824, in process_recipes
      rval = check(self, mf)
    File "/Users/mik/Desktop/Projects/Test/virtenv/lib/python3.4/site-packages/py2app/recipes/virtualenv.py", line 80, in check
      mf.scan_code(co, m)
  AttributeError: 'ModuleGraph' object has no attribute 'scan_code'
  </code></pre>
  
  <p>Can someone please explain whats going on and how to fix it?</p>
  
  <p>EDIT: <a href="https://pythonhosted.org/modulegraph/modulegraph.html#modulegraph.modulegraph.scan_code" rel="noreferrer">here</a> is the documentation for scan_code in modulegraph.py, however the file found in Projects/Test/virtenv/lib/python3.4/site-packages/modulegraph/modulegraph.py contains a function called _scan_code with a leading underscore. Is this some type of change that broke py2app?</p>
  
  <p>EDIT: posted <a href="https://bitbucket.org/ronaldoussoren/modulegraph/issue/22/scan_code-in-modulegraphpy-contains-a" rel="noreferrer">this</a></p>
  
  <p>EDIT: Manually removing leading underscores from a couple function definitions in the file mentioned allowed py2app to run without error. I'm still confused regarding what happened</p>