Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions ada_url/ada_adapter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from copy import deepcopy
from enum import IntEnum
from typing import (
Dict,
Expand Down Expand Up @@ -271,11 +272,9 @@ def __str__(self):
return self.href

def __repr__(self):
password = self.password
self.password = ''
ret = f'<URL "{self.href}">'
self.password = password
return ret
duplicate = deepcopy(self)
duplicate.password = ''
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I may be annoying one last time: this way it's not obvious from the outside whether there's a password set or not. How about using a placeholder that indicates the presence of data like [...]?

Suggested change
duplicate.password = ''
duplicate.password = '[...]'

return f'<URL "{duplicate.href}">'

@staticmethod
def can_parse(url: str, base: Optional[str] = None) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion ada_url/ada_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ada_obj = Extension(
'ada',
define_macros=[('ADA_INCLUDE_URL_PATTERN', '0')],
language="c++",
language='c++',
sources=['ada_url/ada.cpp'],
include_dirs=[file_dir],
extra_compile_args=compile_args,
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def build_extension(self, ext):
ext.extra_objects[i] = objects[0]
return super().build_extension(ext)


setup(
cmdclass={'build_ext': build_ext},
cffi_modules=[
Expand Down
1 change: 1 addition & 0 deletions update_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Run this script to remove compiled artifacts from source distribution tarballs.
"""

from pathlib import Path
from tarfile import open as tar_open
from tempfile import TemporaryDirectory
Expand Down
Loading