title: error invalid syntax (__init__.py) working with beautiful soup
body: <p>I want to write a simple code that create a html file from a site content. I'm using <code>beautifulsoup 4</code> library. When creating a <code>BeautifulSoup</code> object with:</p>
  
  <pre><code>BeautifulSoup('&lt;html&gt;&lt;/html&gt;')
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Invalid syntax (<strong>init</strong>.py, line 175)</p>
  </blockquote>
  
  <p>and this line makes the error:</p>
  
  <blockquote>
    <p>from bs4 import BeautifulSoup</p>
  </blockquote>
  
  <p>I installed the library by executing <code>setup.py</code>.</p>
  
  <p>What's the problem? </p>
  
  <p>My entire code:</p>
  
  <pre><code>import urllib.request as req
  from bs4 import BeautifulSoup
  
  def main():
      get_announcements("92-93", 1, 153, 12)
  
  def get_announcements(year, term, courseID, group):
      website = req.urlopen('http://ce.sharif.edu/courses/' + year + '/' + str(term) + '/ce' + str(courseID) + '-' + str(group) + '/')
      site_content = website.readall()
  
      soup = BeautifulSoup('&lt;html&gt;&lt;/html&gt;')
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>and error line in the <em>init.py</em> from the library files:</p>
  
  <pre><code>try:
      is_file = os.path.exists(possible_filename)
  except Exception, e:   #ERROR!!
      # This is almost certainly a problem involving
      # characters not valid in filenames on this
      # system. Just let it go.
      pass
  </code></pre>