from oscar.apps.payment.exceptions import PaymentError


class PayPalError(PaymentError):
    pass

try:
    from oscar.apps.payment.exceptions import PaymentError
except ImportError:
    class PaymentError(Exception):
        pass

class PayPalError(PaymentError):
    pass
Make gateway importable without django-oscar installed.
Make gateway importable without django-oscar installed.

+ try:
- from oscar.apps.payment.exceptions import PaymentError
+     from oscar.apps.payment.exceptions import PaymentError
- 
+ except ImportError:
+     class PaymentError(Exception):
+         pass
  
  class PayPalError(PaymentError):
      pass
- 
Make gateway importable without django-oscar installed.
## Code Before:
from oscar.apps.payment.exceptions import PaymentError


class PayPalError(PaymentError):
    pass

## Instruction:
Make gateway importable without django-oscar installed.
## Code After:
try:
    from oscar.apps.payment.exceptions import PaymentError
except ImportError:
    class PaymentError(Exception):
        pass

class PayPalError(PaymentError):
    pass