Преглед изворни кода

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 пре 6 година
родитељ
комит
6a3410a2f6
1 измењених фајлова са 3 додато и 1 уклоњено
  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