sagedev.py: improved patch style detection