Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filepaths to pretty_errors' stacktraces; pretty_errors is installed by PL #9167

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions nemo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

try:
import pretty_errors

pretty_errors.configure(
separator_character='*',
filename_display=pretty_errors.FILENAME_FULL,
line_number_first=True,
display_link=True,
lines_before=5,
lines_after=2,
line_color=pretty_errors.RED + '> ' + pretty_errors.default_config.line_color,
code_color=' ' + pretty_errors.default_config.line_color,
truncate_code=True,
display_locals=True,
)
except ImportError:
Dismissed Show dismissed Hide dismissed
pass

from nemo.package_info import (
__contact_emails__,
Expand Down
Loading