mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	Linux binary build: Return proper exit codes when raising SystemExit
This commit is contained in:
		
							parent
							
								
									527c33bb0d
								
							
						
					
					
						commit
						8265e95b15
					
				@ -386,8 +386,13 @@ class LinuxFreeze(Command):
 | 
			
		||||
                    mod = __import__(sys.calibre_module, fromlist=[1])
 | 
			
		||||
                    func = getattr(mod, sys.calibre_function)
 | 
			
		||||
                    return func()
 | 
			
		||||
                except SystemExit:
 | 
			
		||||
                    raise
 | 
			
		||||
                except SystemExit as err:
 | 
			
		||||
                    if err.code is None:
 | 
			
		||||
                        return 0
 | 
			
		||||
                    if isinstance(err.code, int):
 | 
			
		||||
                        return err.code
 | 
			
		||||
                    print (err.code)
 | 
			
		||||
                    return 1
 | 
			
		||||
                except:
 | 
			
		||||
                    import traceback
 | 
			
		||||
                    traceback.print_exc()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user