From 79e2cdce601488c7e5bde79c76cf3c7aa7f2d2bd Mon Sep 17 00:00:00 2001
From: mtu <maxence.tury@ssi.gouv.fr>
Date: Wed, 3 Feb 2016 11:05:42 +0100
Subject: [PATCH] Remove unneeded aliastypes access

---
 scapy/asn1fields.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scapy/asn1fields.py b/scapy/asn1fields.py
index 6b23f9bd..296ce0a7 100644
--- a/scapy/asn1fields.py
+++ b/scapy/asn1fields.py
@@ -492,9 +492,7 @@ class ASN1F_CHOICE(ASN1F_field):
         else:
             s = str(x)
         if self.instantiated_choices:
-            if len(x.aliastypes) != 1:
-                raise ASN1_Error("ASN1F_CHOICE: could not encode object")
-            cls = x.aliastypes[0]
+            cls = type(x)
             if hash(cls) not in x.overload_fields:
                 raise ASN1_Error("ASN1F_CHOICE: could not encode object")
             tags = x.overload_fields[hash(cls)]
-- 
GitLab