Skip to content

Commit 55ea312

Browse files
author
Kareem Zidane
authored
Merge pull request #39 from cs50/develop
using yellow instead of dark
2 parents a849276 + a82d84e commit 55ea312

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
package_dir={"": "src"},
1717
packages=["cs50"],
1818
url="https://github.com/cs50/python-cs50",
19-
version="2.3.0"
19+
version="2.3.1"
2020
)

src/cs50/cs50.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ def formatException(type, value, tb):
5555
# Absolute paths to site-packages
5656
packages = tuple(join(abspath(p), "") for p in sys.path[1:])
5757

58-
# Darken lines referring to files in site-packages
58+
# Highlight lines not referring to files in site-packages
5959
lines = []
6060
for line in format_exception(type, value, tb):
6161
matches = re.search(r"^ File \"([^\"]+)\", line \d+, in .+", line)
6262
if matches and matches.group(1).startswith(packages):
63-
lines += colored(line, attrs=["dark"])
64-
else:
6563
lines += line
64+
else:
65+
matches = re.search(r"^(\s*)(.*?)(\s*)$", line, re.DOTALL)
66+
lines.append(matches.group(1) + colored(matches.group(2), "yellow") + matches.group(3))
6667
return "".join(lines).rstrip()
6768

6869

0 commit comments

Comments
 (0)