
from ctypes import CDLL
import sys
from warnings import warn

import pkg_resources


# Determine shared-library suffix
if sys.platform == 'darwin':
    _suffix = 'dylib'
else:
    _suffix = 'so'

# Open shared library
_filename = pkg_resources.resource_filename(
    __name__, '_libopenmc.{}'.format(_suffix))
try:
    _dll = CDLL(_filename)
except OSError:
    warn("OpenMC shared library is not available from the Python API. This "
         "means you will not be able to use openmc.capi to make in-memory "
         "calls to OpenMC.")
else:
    from .error import *
    from .core import *
    from .nuclide import *
    from .material import *
    from .cell import *
    from .tally import *


from ctypes import CDLL
import sys
from warnings import warn

import pkg_resources


# Determine shared-library suffix
if sys.platform == 'darwin':
    _suffix = 'dylib'
else:
    _suffix = 'so'

# Open shared library
_filename = pkg_resources.resource_filename(
    __name__, '_libopenmc.{}'.format(_suffix))
_dll = CDLL(_filename)

from .error import *
from .core import *
from .nuclide import *
from .material import *
from .cell import *
from .tally import *

Remove try/except block around CDLL
Remove try/except block around CDLL

  
  from ctypes import CDLL
  import sys
  from warnings import warn
  
  import pkg_resources
  
  
  # Determine shared-library suffix
  if sys.platform == 'darwin':
      _suffix = 'dylib'
  else:
      _suffix = 'so'
  
  # Open shared library
  _filename = pkg_resources.resource_filename(
      __name__, '_libopenmc.{}'.format(_suffix))
- try:
-     _dll = CDLL(_filename)
+ _dll = CDLL(_filename)
- except OSError:
-     warn("OpenMC shared library is not available from the Python API. This "
-          "means you will not be able to use openmc.capi to make in-memory "
-          "calls to OpenMC.")
- else:
-     from .error import *
-     from .core import *
-     from .nuclide import *
-     from .material import *
-     from .cell import *
-     from .tally import *
  
+ from .error import *
+ from .core import *
+ from .nuclide import *
+ from .material import *
+ from .cell import *
+ from .tally import *
+ 
Remove try/except block around CDLL
## Code Before:

from ctypes import CDLL
import sys
from warnings import warn

import pkg_resources


# Determine shared-library suffix
if sys.platform == 'darwin':
    _suffix = 'dylib'
else:
    _suffix = 'so'

# Open shared library
_filename = pkg_resources.resource_filename(
    __name__, '_libopenmc.{}'.format(_suffix))
try:
    _dll = CDLL(_filename)
except OSError:
    warn("OpenMC shared library is not available from the Python API. This "
         "means you will not be able to use openmc.capi to make in-memory "
         "calls to OpenMC.")
else:
    from .error import *
    from .core import *
    from .nuclide import *
    from .material import *
    from .cell import *
    from .tally import *

## Instruction:
Remove try/except block around CDLL
## Code After:

from ctypes import CDLL
import sys
from warnings import warn

import pkg_resources


# Determine shared-library suffix
if sys.platform == 'darwin':
    _suffix = 'dylib'
else:
    _suffix = 'so'

# Open shared library
_filename = pkg_resources.resource_filename(
    __name__, '_libopenmc.{}'.format(_suffix))
_dll = CDLL(_filename)

from .error import *
from .core import *
from .nuclide import *
from .material import *
from .cell import *
from .tally import *
