Closed AndyCWB closed 8 months ago
Something doesn't seem to add up. The exception mentions gencache.py:64
, not gencache.py:771-776
. Line 64 doesn't have mixed indentation. It also seems like usage
method could only be called from executing the module anyway, not importing it. Tabs in strings is fine anyway.
I was not able to replicate, even with this simplified scenario:
import sys
print(sys.version)
print(sys.platform)
def usage():
usageString = """\
Usage: gencache [-q] [-d] [-r]
-q - Quiet
-d - Dump the cache (typelibrary description and filename).
-r - Rebuild the cache dictionary from the existing .py files
"""
print(usageString)
usage()
3.8.5 (default, Jul 20 2020, 23:11:29)
[GCC 9.3.0]
linux
Usage: gencache [-q] [-d] [-r]
-q - Quiet
-d - Dump the cache (typelibrary description and filename).
-r - Rebuild the cache dictionary from the existing .py files
I still think it would be better to not mix indent in strings out of principle and consistency (and this isn't caught by black because it's in a string obviously). So I opened #2167
Expected behavior and actual behavior. Expected: import of win32 modules does not produce an error. Actual (edited to remove proprietary path information:
Steps to reproduce the problem. import win32com.client
Version of Python and pywin32 Python 3.8.18 and pywin32 v306
Fix: convert all indentation to spaces in the usage() function - lines 771-776 in gencache.py