Skip to content

Bare Except Statement in jbt.py #17

@mfixstsci

Description

@mfixstsci

pep8speaks caught a bare except. I have seen this issue with urllib appear in the past and one way around it is to remove and use the python 3 import only since python 2 won't be/isn't supported anymore. If that solution isn't the most robust, we just add ImportError after the except statement:

  try:
      # Python 3
      # Read the background cache version
      version_file = urllib.request.urlopen(self.cache_url + 'VERSION')
      sbet_file = urllib.request.urlopen(self.cache_url + cache_file)
  except ImportError:
      # Python 2
      # Read the background cache version
      version_file = urllib.urlopen(self.cache_url + 'VERSION')
      sbet_file = urllib.urlopen(self.cache_url + cache_file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions