Python Forum
Catching exceptions in embedded code no longer works on 3.7.2?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Catching exceptions in embedded code no longer works on 3.7.2?
#1
In an older project of mine I used to catch exceptions in the code by doing ...

// simplified code ...
PyObject * PyRes = PyRun_String( ... )
...
PyObject* ex = PyErr_Occurred();
...
if (!PyErr_ExceptionMatches(PyExc_SystemExit))
{
  // there was a non-system error
}
But now I get the error, (in VS2017)

Error:
Error LNK2001 unresolved external symbol PyExc_SystemExit
I suspect i need to include something to my project/files?
Any suggestions as to what might be missing?

Many thanks

FFMG
Reply


Messages In This Thread
Catching exceptions in embedded code no longer works on 3.7.2? - by FFMG - Feb-01-2019, 08:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 1,056 Nov-15-2023, 06:56 PM
Last Post: jst
  How to run detectron2, as python embedded code in C++, on GPU? hassaniqbal931 3 1,119 Nov-02-2023, 04:45 PM
Last Post: blabling2
  Code works but doesn't give the right results colin_dent 2 728 Jun-22-2023, 06:04 PM
Last Post: jefsummers
  Beginner: Code not work when longer list raiviscoding 2 833 May-19-2023, 11:19 AM
Last Post: deanhystad
  Code used to work 100%, now sometimes works! muzicman0 5 1,459 Jan-13-2023, 05:09 PM
Last Post: muzicman0
  PiCamera - print exceptions? korenron 2 845 Dec-15-2022, 10:48 PM
Last Post: Larz60+
  a longer docstring Skaperen 8 1,690 Aug-25-2022, 11:21 PM
Last Post: Skaperen
  Class exceptions DPaul 1 1,304 Mar-11-2022, 09:01 AM
Last Post: Gribouillis
  Pyspark - my code works but I want to make it better Kevin 1 1,799 Dec-01-2021, 05:04 AM
Last Post: Kevin
  Catching a crash within a library code ebolisa 9 3,191 Nov-22-2021, 11:02 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020