Skip to content

Commit d688079

Browse files
committed
Fix the test as the os.path.abspath(None) will cause error in linux
system. See https://bugs.python.org/issue22587
1 parent f8d3529 commit d688079

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

about_code_tool/about.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,14 @@ class AboutFile(object):
557557
"""
558558
def __init__(self, location=None):
559559
self.about_resource = None
560-
self.location = os.path.abspath(location)
560+
# The os.path.abspath(None) will cause error in linux system.
561+
# See https://bugs.python.org/issue22587
562+
# Note that the os.path.abspath is needed for windows when there
563+
# is long path/filename.
564+
if on_windows:
565+
self.location = os.path.abspath(location)
566+
else:
567+
self.location = location
561568

562569
self.parsed = None
563570
self.parsed_fields = None

0 commit comments

Comments
 (0)