Skip to content

Commit

Permalink
Fixed after PR reviewed
Browse files Browse the repository at this point in the history
  • Loading branch information
newwingbird committed Nov 17, 2024
1 parent 9cfd602 commit 56e0eef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions comtypes/client/_code_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ def _find_gen_dir():
# check type of executable image to determine a subdirectory
# where generated modules are placed.
ftype = getattr(sys, "frozen", None)
version_str = f"{sys.version_info[0]:d}{sys.version_info[1]:d}"
pymaj, pymin = sys.version_info[:2]
if ftype == None:
# Python script
subdir = f"Python\\Python{version_str}\\comtypes_cache"
subdir = f"Python\\Python{pymaj:d}{pymin:d}\\comtypes_cache"
basedir = _get_appdata_dir()

elif ftype == "dll":
# dll created with py2exe
path = _get_module_filename(sys.frozendllhandle)
base = os.path.splitext(os.path.basename(path))[0]
subdir = f"comtypes_cache\\{base}-{version_str}"
subdir = f"Python\\Python{pymaj:d}{pymin:d}\\comtypes_cache"
basedir = tempfile.gettempdir()

else: # ftype in ('windows_exe', 'console_exe')
# exe created by py2exe
base = os.path.splitext(os.path.basename(sys.executable))[0]
subdir = f"comtypes_cache\\{base}-{version_str}"
subdir = f"comtypes_cache\\{base}-{pymaj:d}{pymin:d}"
basedir = tempfile.gettempdir()

gen_dir = os.path.join(basedir, subdir)
Expand Down
2 changes: 1 addition & 1 deletion comtypes/client/_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def __getattr__(self, name):
"Create event handler methods on demand"
if name.startswith("__") and name.endswith("__"):
raise AttributeError(name)
print(f"# event found: {name}")
print("# event found:", name)

def handler(self, this, *args, **kw):
# XXX handler is called with 'this'. Should we really print "None" instead?
Expand Down

0 comments on commit 56e0eef

Please sign in to comment.