Use fallback if HOME is not set.
This commit is contained in:
		
							parent
							
								
									3e370bfa52
								
							
						
					
					
						commit
						2f3705bb12
					
				@ -70,13 +70,13 @@ def _find_system_cache_dir() -> str:
 | 
				
			|||||||
    if os.name == 'posix':
 | 
					    if os.name == 'posix':
 | 
				
			||||||
        if 'XDG_CACHE_HOME' in os.environ:
 | 
					        if 'XDG_CACHE_HOME' in os.environ:
 | 
				
			||||||
            return os.environ['XDG_CACHE_HOME']
 | 
					            return os.environ['XDG_CACHE_HOME']
 | 
				
			||||||
        else:
 | 
					        elif 'HOME' in os.environ:
 | 
				
			||||||
            return os.path.join(os.environ['HOME'], '.cache')
 | 
					            return os.path.join(os.environ['HOME'], '.cache')
 | 
				
			||||||
    elif os.name == 'nt':
 | 
					    elif os.name == 'nt':
 | 
				
			||||||
        # TODO: just guessing
 | 
					        # TODO: just guessing
 | 
				
			||||||
        return os.environ['LocalAppData']
 | 
					        return os.environ['LocalAppData']
 | 
				
			||||||
    else: # fallback
 | 
					    # fallback
 | 
				
			||||||
        return Dir('#cache').abspath
 | 
					    return Dir('#cache').abspath
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Import('config')
 | 
					Import('config')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user