未验证 提交 d07ad4c6 编写于 作者: Z Zeng Jinle 提交者: GitHub

add more traceback to py_reader error msg, test=develop (#18722)

上级 a3028bb7
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
| reyoung | Yang Yu | | reyoung | Yang Yu |
| Sand3r- | Michal Gallus | | Sand3r- | Michal Gallus |
| sfraczek | Sylwester Fraczek | | sfraczek | Sylwester Fraczek |
| sneaxiy | Jin-Le Zeng |
| Superjom | Chun-Wei Yan | | Superjom | Chun-Wei Yan |
| tensor-tang | Jian Tang | | tensor-tang | Jian Tang |
| tianbingsz | Tian-Bing Xu | | tianbingsz | Tian-Bing Xu |
......
...@@ -17,6 +17,7 @@ from ..wrapped_decorator import signature_safe_contextmanager ...@@ -17,6 +17,7 @@ from ..wrapped_decorator import signature_safe_contextmanager
import multiprocessing import multiprocessing
import os import os
import six import six
import sys
import threading import threading
from ..data_feeder import DataFeeder from ..data_feeder import DataFeeder
...@@ -595,7 +596,7 @@ def _py_reader(capacity, ...@@ -595,7 +596,7 @@ def _py_reader(capacity,
except Exception as ex: except Exception as ex:
feed_queue.close() feed_queue.close()
logging.warn('Your decorated reader has raised an exception!') logging.warn('Your decorated reader has raised an exception!')
raise ex six.reraise(*sys.exc_info())
reader.thread = threading.Thread(target=__provider_thread__) reader.thread = threading.Thread(target=__provider_thread__)
reader.thread.daemon = True reader.thread.daemon = True
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
from . import core, dygraph from . import core, dygraph
import sys
import six import six
import warnings import warnings
import numpy as np import numpy as np
...@@ -443,7 +444,7 @@ class PyReader(object): ...@@ -443,7 +444,7 @@ class PyReader(object):
except Exception as ex: except Exception as ex:
self._queue.close() self._queue.close()
logging.warn('Your decorated reader has raised an exception!') logging.warn('Your decorated reader has raised an exception!')
raise ex six.reraise(*sys.exc_info())
self._thread = threading.Thread(target=__thread_main__) self._thread = threading.Thread(target=__thread_main__)
self._thread.daemon = True self._thread.daemon = True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册