Changeset - 755b2c66b462
[Not reviewed]
default
0 4 0
Mads Kiilerich (mads) - 6 years ago 2020-08-18 22:25:45
mads@kiilerich.com
Grafted from: 322508f5a0ba
pytype: mute errors from import of optional or platform specific modules

Mute pytype warnings:

File "kallithea/bin/kallithea_cli_iis.py", line 69, in iis_install: Can't find module 'isapi_wsgi'. [import-error]
File "kallithea/config/post_receive_tmpl.py", line 24, in <module>: No attribute 'setmode' on module 'msvcrt' [module-attr]
File "kallithea/config/pre_receive_tmpl.py", line 24, in <module>: No attribute 'setmode' on module 'msvcrt' [module-attr]
File "kallithea/lib/compat.py", line 59, in kill: No attribute 'windll' on module 'ctypes' [module-attr]
File "kallithea/lib/utils.py", line 242, in is_valid_repo_uri: Can't find module 'hgsubversion.svnrepo'. [import-error]
File "kallithea/tests/scripts/manual_test_concurrency.py", line 203, in <module>: No attribute '_RandomNameSequence' on module 'tempfile' [module-attr]
4 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_iis.py
Show inline comments
 
@@ -65,7 +65,7 @@ def iis_install(virtualdir, config):
 
    config_file_abs = config['__file__']
 

	
 
    try:
 
        import isapi_wsgi
 
        import isapi_wsgi  # pytype: disable=import-error
 
        assert isapi_wsgi
 
    except ImportError:
 
        sys.stderr.write('missing requirement: isapi-wsgi not installed\n')
kallithea/lib/compat.py
Show inline comments
 
@@ -56,7 +56,7 @@ if os.name == 'nt': # Windows
 

	
 
    def kill(pid, sig):
 
        """kill function for Win32"""
 
        kernel32 = ctypes.windll.kernel32
 
        kernel32 = ctypes.windll.kernel32  # pytype: disable=module-attr
 
        handle = kernel32.OpenProcess(1, 0, pid)
 
        return (0 != kernel32.TerminateProcess(handle, 0))
 

	
kallithea/templates/py/git_post_receive_hook.py
Show inline comments
 
@@ -22,7 +22,7 @@ import kallithea.bin.vcs_hooks
 
# instead of the exception output.
 
if sys.platform == "win32":
 
    import msvcrt
 
    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
 
    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)  # pytype: disable=module-attr
 

	
 
KALLITHEA_HOOK_VER = '_TMPL_'
 
os.environ['KALLITHEA_HOOK_VER'] = KALLITHEA_HOOK_VER
kallithea/tests/scripts/manual_test_concurrency.py
Show inline comments
 
@@ -199,7 +199,7 @@ if __name__ == '__main__':
 
            backend = 'hg'
 

	
 
        if METHOD == 'pull':
 
            seq = next(tempfile._RandomNameSequence())
 
            seq = next(tempfile._RandomNameSequence())  # pytype: disable=module-attr
 
            test_clone_with_credentials(repo=sys.argv[1], method='clone',
 
                                        backend=backend)
 
        s = time.time()
0 comments (0 inline, 0 general)