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

kpex/FasterCap: ignore max path length handling for Windows #10

Merged
merged 1 commit into from
Dec 5, 2024
Merged
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
8 changes: 6 additions & 2 deletions kpex/fastercap/fastercap_model_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,11 @@ def finalize(self):
self.diel_data = dk

def write_fastcap(self, output_dir_path: str, prefix: str) -> str:
max_filename_length = os.pathconf(output_dir_path, 'PC_NAME_MAX')
max_filename_length: Optional[int] = None
try:
max_filename_length = os.pathconf(output_dir_path, 'PC_NAME_MAX')
except AttributeError:
pass # NOTE: windows does not support the os.pathconf attribute

lst_fn = os.path.join(output_dir_path, f"{prefix}.lst")
file_num = 0
Expand Down Expand Up @@ -790,7 +794,7 @@ def write_fastcap(self, output_dir_path: str, prefix: str) -> str:
outside = outside or '(void)'
# lst_file.append(f"* Conductor interface: outside={outside}, net={nn}")
fn = f"{prefix}{file_num}_outside={outside}_net={nn}.geo"
if len(fn) > max_filename_length:
if max_filename_length is not None and len(fn) > max_filename_length:
warning(f"Unusual long net name detected: {nn}")
d = hashlib.md5(nn.encode('utf-8')).digest()
h = base64.urlsafe_b64encode(d).decode('utf-8').rstrip('=')
Expand Down
Loading