mardi 12 novembre 2019

Q: 'UnboundLocalError': local variable 'exitErr' referenced before assignment

I want to use the PDE Solver Fipy in the Spyder IDE and tried installing it according to the official installation guide: Now it is suggested to run fipy.test() before using the package and here the following error appeared.

File "C:\Users\Me\AppData\Roaming\Python\Python27\site-packages\fipy\tests\test.py", line 263, in run_tests raise exitErr

UnboundLocalError: local variable 'exitErr' referenced before assignment

I quite do not understand what this means in this context, here is the code that this Error is reffering to:

    "try:
        unittest.main(
            None, None, [unittest.__file__]+self.test_args,
            testLoader = loader_class()
            )
    except SystemExit as exitErr:
        # unittest.main(..., exit=...) not available until Python 2.7
        from fipy.tests.doctestPlus import report_skips
        report_skips()
        if self.timetests is not None:
            pass
        else:
            raise

    if "legacy" in printoptions:
        numerix.set_printoptions(legacy=printoptions["legacy"])

    if self.timetests is not None:
        from fipy.tests.doctestPlus import _DocTestTimes
        import numpy
        _DocTestTimes = numpy.rec.fromrecords(_DocTestTimes, formats='f8,S255', names='time,test')
        _DocTestTimes.sort(order=('time', 'test'))
        numpy.savetxt(self.timetests, _DocTestTimes[::-1], fmt="%8.4f\t%s")

    raise exitErr

Aucun commentaire:

Enregistrer un commentaire