Explorar o código

Import sympy (if it exists) regardless of the setting of symbolic_byte_counters

So that symbolic_byte_counters could be set to True at runtime
Ian Goldberg %!s(int64=5) %!d(string=hai) anos
pai
achega
6a3410a2f6
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      network.py

+ 3 - 1
network.py

@@ -12,8 +12,10 @@ from enum import Enum
 # You will need sympy installed for this to work.
 symbolic_byte_counters = False
 
-if symbolic_byte_counters:
+try:
     import sympy
+except:
+    pass
 
 # Network parameters