Skip to content

Commit

Permalink
Small change of is_valid_function_name
Browse files Browse the repository at this point in the history
Slightly increases readability.
  • Loading branch information
j-t-1 authored Dec 16, 2024
1 parent 3598bdc commit ea45151
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,7 @@ def is_valid_dos_filename(s):
# charset we will assume the name is invalid.
# The dot "." character comes from: https://github.com/erocarrera/pefile/pull/346
# All other symbols can be inserted by adding a name with that symbol to a .def file,
# and passing it to link.exe (See export_test.py)
# and passing it to link.exe, see export_test.py.
allowed_function_name = (
string.ascii_lowercase + string.ascii_uppercase + string.digits
).encode()
Expand All @@ -2316,9 +2316,9 @@ def is_valid_dos_filename(s):
def is_valid_function_name(
s: Union[str, bytes, bytearray], relax_allowed_characters: bool = False
) -> bool:
allowed_extra = b"._?@$()<>"
allowed_extra = b"$().<>?@_"
if relax_allowed_characters:
allowed_extra += b"!\"#%&'*+,-/:[\\]^`{|}~"
allowed_extra = string.punctuation.encode()
return (
s is not None
and isinstance(s, (str, bytes, bytearray))
Expand Down

0 comments on commit ea45151

Please sign in to comment.